Re: [PATCH] sis900 fix (Was: [CHECKER] Resource leaks in driver shutdown functions)

From: Daniele Venzano
Date: Tue May 04 2004 - 12:55:27 EST


On Tue, May 04, 2004 at 08:28:49AM -0700, Randy.Dunlap wrote:
> On Tue, 4 May 2004 10:43:26 +0200 Daniele Venzano wrote:
>
> | Thank you for the spotting, the sis900 dirver was really missing a call
> | to netif_device_detach in sis900_suspend.
> |
> | Attached is a trivial patch that fixes the issue.
>
> Just how trivial is the patch?
A one liner, against 2.6.5.

> -ENOATTACHMENT
Sorry, now is attached and is available at this url:
http://teg.homeunix.org/kernel_patches.html

The patch is tested, compiles and run. Could not test that very code
path because of other unrelated errors during suspend, that I was having
before this change.
But it's really a bug, there is a call to netif_device_attach inside
sis900_resume, but there is no corresponding netif_device_detach in
sis900_suspend.

Hope this clarifies.

--
-----------------------------
Daniele Venzano
Web: http://teg.homeunix.org

--- linux-2.6.5/drivers/net/sis900.c 2004-04-05 17:33:30.000000000 +0200
+++ linux-2.6.5-exp/drivers/net/sis900.c 2004-05-04 10:15:06.000000000 +0200
@@ -2195,6 +2195,7 @@
return 0;

netif_stop_queue(net_dev);
+ netif_device_detach(net_dev);

/* Stop the chip's Tx and Rx Status Machine */
outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr);