From: Greg KH <gregkh@linuxfoundation.org>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Cc: rafael@kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] PNP: add put_device() in pnpbios_init()
Date: Thu, 18 Dec 2025 11:03:45 +0100 [thread overview]
Message-ID: <2025121808-grit-earpiece-51ed@gregkh> (raw)
In-Reply-To: <20251218081955.548521-1-lihaoxiang@isrc.iscas.ac.cn>
On Thu, Dec 18, 2025 at 04:19:55PM +0800, Haoxiang Li wrote:
> If pnp_register_protocol() fails, call put_device()
> to drop the device reference.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> drivers/pnp/pnpbios/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pnp/pnpbios/core.c b/drivers/pnp/pnpbios/core.c
> index f7e86ae9f72f..997e0153d6e3 100644
> --- a/drivers/pnp/pnpbios/core.c
> +++ b/drivers/pnp/pnpbios/core.c
> @@ -538,6 +538,7 @@ static int __init pnpbios_init(void)
> /* register with the pnp layer */
> ret = pnp_register_protocol(&pnpbios_protocol);
> if (ret) {
> + put_device(&pnpbios_protocol.dev)
This feels wrong, as this is a static structure, why would it have a
reference count? Something is not working properly here if this is
required.
What testing caused this to trigger? How was this found?
thanks,
greg k-h
next prev parent reply other threads:[~2025-12-18 10:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-18 8:19 [PATCH] PNP: add put_device() in pnpbios_init() Haoxiang Li
2025-12-18 10:03 ` Greg KH [this message]
2025-12-20 16:41 ` kernel test robot
2025-12-20 21:05 ` kernel test robot
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=2025121808-grit-earpiece-51ed@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--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