projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7c911f9
)
interconnect: core: fix error return code of icc_link_destroy()
author
Jia-Ju Bai
<baijiaju1990@gmail.com>
Mon, 8 Mar 2021 13:09:15 +0000
(15:09 +0200)
committer
Georgi Djakov
<georgi.djakov@linaro.org>
Mon, 8 Mar 2021 13:09:15 +0000
(15:09 +0200)
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>
drivers/interconnect/core.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/interconnect/core.c
b/drivers/interconnect/core.c
index 5ad519c9f2396cea0d25b0dd30ef0d6de24b5555..8a1e70e008764b09b27e43ee66b69ae045086b7b 100644
(file)
--- 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);