[PATCH 6.6 472/508] powerpc/warp: Fix error handling in pika_dtm_thread
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2026-05-20 18:49:43
Also in:
stable
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2026-05-20 18:49:43
Also in:
stable
6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Ke <redacted>
commit 108d7f951271cbd36ca36efc5e5d106966f5180c upstream.
pika_dtm_thread() acquires client through of_find_i2c_device_by_node()
but fails to release it in error handling path. This could result in a
reference count leak, preventing proper cleanup and potentially
leading to resource exhaustion. Add put_device() to release the
reference in the error handling path.
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 3984114f0562 ("powerpc/warp: Platform fix for i2c change")
Signed-off-by: Ma Ke <redacted>
Reviewed-by: Christophe Leroy <redacted>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20251116024411.21968-1-make24@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/platforms/44x/warp.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/powerpc/platforms/44x/warp.c
+++ b/arch/powerpc/platforms/44x/warp.c@@ -292,6 +292,8 @@ static int pika_dtm_thread(void __iomem schedule_timeout(HZ); } + put_device(&client->dev); + return 0; }