linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 5.4 01/13] interconnect: core: fix error return code of icc_link_destroy()
@ 2021-04-05 16:04 Sasha Levin
  2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 02/13] KVM: arm64: Hide system instruction access to Trace registers Sasha Levin
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sasha Levin @ 2021-04-05 16:04 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jia-Ju Bai, TOTE Robot, Georgi Djakov, Sasha Levin, linux-pm

From: Jia-Ju Bai <baijiaju1990@gmail.com>

[ 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 | 2 ++
 1 file changed, 2 insertions(+)

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);
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-04-05 16:07 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 16:04 [PATCH AUTOSEL 5.4 01/13] interconnect: core: fix error return code of icc_link_destroy() Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 02/13] KVM: arm64: Hide system instruction access to Trace registers Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 03/13] KVM: arm64: Disable guest access to trace filter controls Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 04/13] drm/imx: imx-ldb: fix out of bounds array access warning Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 05/13] gfs2: report "already frozen/thawed" errors Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 06/13] drm/tegra: dc: Don't set PLL clock to 0Hz Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 07/13] radix tree test suite: Fix compilation Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 08/13] block: only update parent bi_status when bio fail Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 09/13] radix tree test suite: Register the main thread with the RCU library Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 10/13] idr test suite: Take RCU read lock in idr_find_test_1 Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 11/13] idr test suite: Create anchor before launching throbber Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 12/13] riscv,entry: fix misaligned base for excp_vect_table Sasha Levin
2021-04-05 16:04 ` [PATCH AUTOSEL 5.4 13/13] block: don't ignore REQ_NOWAIT for direct IO Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).