[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025121808-grit-earpiece-51ed@gregkh>
Date: Thu, 18 Dec 2025 11:03:45 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Haoxiang Li <lihaoxiang@...c.iscas.ac.cn>
Cc: rafael@...nel.org, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] PNP: add put_device() in pnpbios_init()
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@...r.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@...c.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
Powered by blists - more mailing lists