mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
interconnect: core: fix error return code of icc_link_destroy()
[ Upstream commit 715ea61532 ]
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 <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210306132857.17020-1-baijiaju1990@gmail.com
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1e798745fa
commit
9b57ecb01b
@@ -942,6 +942,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst)
|
|||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (new)
|
if (new)
|
||||||
src->links = new;
|
src->links = new;
|
||||||
|
else
|
||||||
|
ret = -ENOMEM;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&icc_lock);
|
mutex_unlock(&icc_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user