interconnect: core: fix error return code of icc_link_destroy()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Mon, 8 Mar 2021 13:09:15 +0000 (15:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Apr 2021 09:43:19 +0000 (11:43 +0200)
commit9b57ecb01b43f50c93b33a19155618357f98cbfc
tree3b16d967a51a1be6bef5cd2696b8749d1cf0f224
parent1e798745fa8ef91ffe4fd38d443f9d44b59e3cb3
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 <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>
drivers/interconnect/core.c