From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Ma Ke <make24@iscas.ac.cn>,
maddy@linux.ibm.com, mpe@ellerman.id.au, npiggin@gmail.com,
benh@kernel.crashing.org, smaclennan@pikatech.com
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, stable@vger.kernel.org
Subject: Re: [PATCH] powerpc/warp: Fix error handling in pika_dtm_thread
Date: Wed, 19 Nov 2025 16:37:59 +0100 [thread overview]
Message-ID: <657c8574-8844-48ef-93e1-e0df8e9cf91a@csgroup.eu> (raw)
In-Reply-To: <20251116024411.21968-1-make24@iscas.ac.cn>
Le 16/11/2025 à 03:44, Ma Ke a écrit :
> ***ATTENTION, Sopra Steria Group cannot confirm the identity of this email sender (SPF record failure). This might be a fake email from an attacker, if you have any doubts report and delete the email.***
>
> ***ATTENTION, Sopra Steria Group ne peut pas confirmer l’identité de l’émetteur de ce message (SPF record failure). Il pourrait s’agir d’un faux message, à détruire si vous avez un doute ***
>
> 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.
It is not really an error path, it is the termination of the kthread.
>
> Found by code review.
>
> Cc: stable@vger.kernel.org
> Fixes: 3984114f0562 ("powerpc/warp: Platform fix for i2c change")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/platforms/44x/warp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/platforms/44x/warp.c b/arch/powerpc/platforms/44x/warp.c
> index a5001d32f978..6f674f86dc85 100644
> --- a/arch/powerpc/platforms/44x/warp.c
> +++ b/arch/powerpc/platforms/44x/warp.c
> @@ -293,6 +293,8 @@ static int pika_dtm_thread(void __iomem *fpga)
> schedule_timeout(HZ);
> }
>
> + put_device(&client->dev);
> +
> return 0;
> }
>
> --
> 2.17.1
>
next prev parent reply other threads:[~2025-11-19 15:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-16 2:44 [PATCH] powerpc/warp: Fix error handling in pika_dtm_thread Ma Ke
2025-11-19 15:37 ` Christophe Leroy [this message]
2026-05-18 5:43 ` Madhavan Srinivasan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=657c8574-8844-48ef-93e1-e0df8e9cf91a@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=akpm@linux-foundation.org \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=make24@iscas.ac.cn \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=smaclennan@pikatech.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox