Commit 108d7f95 authored by Ma Ke's avatar Ma Ke Committed by Madhavan Srinivasan
Browse files

powerpc/warp: Fix error handling in pika_dtm_thread



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: 3984114f ("powerpc/warp: Platform fix for i2c change")
Signed-off-by: default avatarMa Ke <make24@iscas.ac.cn>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMadhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20251116024411.21968-1-make24@iscas.ac.cn
parent acd1e47d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -293,6 +293,8 @@ static int pika_dtm_thread(void __iomem *fpga)
		schedule_timeout(HZ);
	}

	put_device(&client->dev);

	return 0;
}