Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH] PNP: add put_device() in pnpbios_init()
@ 2025-12-18  8:19 Haoxiang Li
  2025-12-18 10:03 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Haoxiang Li @ 2025-12-18  8:19 UTC (permalink / raw)
  To: rafael, lihaoxiang; +Cc: linux-acpi, linux-kernel, stable

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)
 		printk(KERN_ERR
 		       "PnPBIOS: Unable to register driver.  Aborting.\n");
 		return ret;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-12-20 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  8:19 [PATCH] PNP: add put_device() in pnpbios_init() Haoxiang Li
2025-12-18 10:03 ` Greg KH
2025-12-20 16:41 ` kernel test robot
2025-12-20 21:05 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox