]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fwd: Re: Atmel - possible SKB leak?
authorDmitry Torokhov <dtor_core@ameritech.net>
Mon, 15 Dec 2003 19:56:37 +0000 (14:56 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 15 Dec 2003 19:56:37 +0000 (14:56 -0500)
Jeff,

Atmel driver in 2.6.0-test11 is leaking SKBs if card gets disassociated
from an AP when it's about to transfer packet. Simon (atmel maintainer)
is OK with the patch. Given the fact that we are leaking memory I think
it may be beneficial to push it to Linus (if you like the patch).

Dmitry

===================================================================

ChangeSet@1.1517, 2003-12-11 01:44:56-05:00, dtor_core@ameritech.net
  NET: atmel - do not leak SKBs when dropping packets

 atmel.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

===================================================================

drivers/net/wireless/atmel.c

index 87e8e8040a391cdda00a07a56f304d77389794eb..85c066dba3f17fc7d8dd01e753399860f9409098 100644 (file)
@@ -748,13 +748,13 @@ static int start_tx (struct sk_buff *skb, struct net_device *dev)
        
        if(priv->station_state != STATION_STATE_READY) {
                priv->stats.tx_errors++;
-               return 0;
+               goto done;
        }
        
        if (priv->card && priv->present_callback && 
            !(*priv->present_callback)(priv->card)) {
                priv->stats.tx_errors++;
-               return 0;
+               goto done;
        }
        
        /* first ensure the timer func cannot run */
@@ -804,6 +804,8 @@ static int start_tx (struct sk_buff *skb, struct net_device *dev)
        
        spin_unlock_irqrestore(&priv->irqlock, flags);
        spin_unlock_bh(&priv->timerlock);
+
+done:
        dev_kfree_skb(skb);
        
        return 0;