Commit 715ea615 authored by Jia-Ju Bai's avatar Jia-Ju Bai Committed by Georgi Djakov

interconnect: core: fix error return code of icc_link_destroy()

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: default avatarTOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20210306132857.17020-1-baijiaju1990@gmail.comSigned-off-by: default avatarGeorgi Djakov <georgi.djakov@linaro.org>
parent 7c911f9d
...@@ -942,6 +942,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst) ...@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment