drivers/pnp/isapnp/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
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/isapnp/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 219f96f2aaaf..d6daab7ed59e 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -983,8 +983,10 @@ static int __init isapnp_init(void)
return -EBUSY;
}
- if (pnp_register_protocol(&isapnp_protocol) < 0)
+ if (pnp_register_protocol(&isapnp_protocol) < 0) {
+ put_device(&isapnp_protocol.dev);
return -EBUSY;
+ }
/*
* Print a message. The existing ISAPnP code is hanging machines
--
2.25.1
On Thu, Dec 18, 2025 at 04:36:46PM +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/isapnp/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
> index 219f96f2aaaf..d6daab7ed59e 100644
> --- a/drivers/pnp/isapnp/core.c
> +++ b/drivers/pnp/isapnp/core.c
> @@ -983,8 +983,10 @@ static int __init isapnp_init(void)
> return -EBUSY;
> }
>
> - if (pnp_register_protocol(&isapnp_protocol) < 0)
> + if (pnp_register_protocol(&isapnp_protocol) < 0) {
> + put_device(&isapnp_protocol.dev);
Same here, this feels very wrong.
How was this tested?
How was this found?
thanks,
greg k-h
© 2016 - 2026 Red Hat, Inc.