All of lore.kernel.org
 help / color / mirror / Atom feed
* [Kernel-janitors] [patch] fix sysfs leak drivers/net/dgrs.c
@ 2004-03-16  9:41 maximilian attems
  2004-03-16 15:02 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: maximilian attems @ 2004-03-16  9:41 UTC (permalink / raw)
  To: kernel-janitors

if the driver fails to load, leaves a dgrs dir in sysfs.

belows patch is far from beautifull,
but keeps logic of dgrs_init_module().

test compiled.

as follow up to:
http://marc.theaimsgroup.com/?l=linux-kernel&m\x107938809308387&w=2

when chasing eisa_driver_register returns,
i found a lot of unchecked pci_register_driver,
should i add this one to kj TODO?

regards
maks


diff -ruN -X dontdiff linux-2.6.4/drivers/net/dgrs.c linux-2.6.4-maks/drivers/net/dgrs.c
--- linux-2.6.4/drivers/net/dgrs.c	2004-03-16 08:47:06.000000000 +0100
+++ linux-2.6.4-maks/drivers/net/dgrs.c	2004-03-16 00:42:41.000000000 +0100
@@ -1586,11 +1586,15 @@
 	 */
 #ifdef CONFIG_EISA
 	eisacount = eisa_driver_register(&dgrs_eisa_driver);
+	if (eisacount <= 0)
+		eisa_driver_unregister(&dgrs_eisa_driver);
 	if (eisacount < 0)
 		return eisacount;
 #endif
 #ifdef CONFIG_PCI
 	pcicount = pci_register_driver(&dgrs_pci_driver);
+	if (pcicount <= 0)
+		pci_unregister_driver(&dgrs_pci_driver);
 	if (pcicount < 0)
 		return pcicount;
 #endif

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

* Re: [Kernel-janitors] [patch] fix sysfs leak drivers/net/dgrs.c
  2004-03-16  9:41 [Kernel-janitors] [patch] fix sysfs leak drivers/net/dgrs.c maximilian attems
@ 2004-03-16 15:02 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-03-16 15:02 UTC (permalink / raw)
  To: kernel-janitors

On Tue, Mar 16, 2004 at 10:41:15AM +0100, maximilian attems wrote:
> if the driver fails to load, leaves a dgrs dir in sysfs.
> 
> belows patch is far from beautifull,
> but keeps logic of dgrs_init_module().
> 
> test compiled.
> 
> as follow up to:
> http://marc.theaimsgroup.com/?l=linux-kernel&m\x107938809308387&w=2
> 
> when chasing eisa_driver_register returns,
> i found a lot of unchecked pci_register_driver,
> should i add this one to kj TODO?

Yes, and all pci_module_init() calls need to be changed to
pci_register_driver() but that's a 2.7 thing...

thanks,

greg k-h
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2004-03-16 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16  9:41 [Kernel-janitors] [patch] fix sysfs leak drivers/net/dgrs.c maximilian attems
2004-03-16 15:02 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.