Skip to content

Commit 1a78bea

Browse files
Ma Kegregkh
authored andcommitted
powerpc/warp: Fix error handling in pika_dtm_thread
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: 3984114 ("powerpc/warp: Platform fix for i2c change") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> 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>
1 parent 3f6fb02 commit 1a78bea

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • arch/powerpc/platforms/44x

arch/powerpc/platforms/44x/warp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ static int pika_dtm_thread(void __iomem *fpga)
293293
schedule_timeout(HZ);
294294
}
295295

296+
put_device(&client->dev);
297+
296298
return 0;
297299
}
298300

0 commit comments

Comments
 (0)