This is a note to let you know that I've just added the patch titled interconnect: core: fix error return code of icc_link_destroy() to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: interconnect-core-fix-error-return-code-of-icc_link_.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 1df7622daf98b95a12db9a298f4ffbf562917de7 Author: Jia-Ju Bai <baijiaju1990@xxxxxxxxx> Date: Mon Mar 8 15:09:15 2021 +0200 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@xxxxxxxxxxxxxxx> Signed-off-by: Jia-Ju Bai <baijiaju1990@xxxxxxxxx> Link: https://lore.kernel.org/r/20210306132857.17020-1-baijiaju1990@xxxxxxxxx Signed-off-by: Georgi Djakov <georgi.djakov@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c index c498796adc07..e579b3633a84 100644 --- a/drivers/interconnect/core.c +++ b/drivers/interconnect/core.c @@ -704,6 +704,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);