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