From: Jia-Ju Bai Date: Mon, 8 Mar 2021 13:09:15 +0000 (+0200) Subject: interconnect: core: fix error return code of icc_link_destroy() X-Git-Tag: v5.10.31~24 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=9b57ecb01b43f50c93b33a19155618357f98cbfc;p=wrapfs-3.14.y.git interconnect: core: fix error return code of icc_link_destroy() [ Upstream commit 715ea61532e731c62392221238906704e63d75b6 ] When krealloc() fails and new is NULL, no error return code of icc_link_destroy() is assigned. To fix this bug, ret is assigned with -ENOMEM hen new is NULL. Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai Link: https://lore.kernel.org/r/20210306132857.17020-1-baijiaju1990@gmail.com Signed-off-by: Georgi Djakov Signed-off-by: Sasha Levin --- diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index 5ad519c9f239..8a1e70e00876 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -942,6 +942,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst) GFP_KERNEL); if (new) src->links = new; + else + ret = -ENOMEM; out: mutex_unlock(&icc_lock);