Atmel - possible SKB leak?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am not quite sure, but in atmel driver, if card looses association
with AP or card gets ejected when it's about to transmit a packet, 
start_tx (hard_start_xmit) will return success but will not free skb.

Will something like the patch below suffice or am I seeing things?

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(-)


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



diff -Nru a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
--- a/drivers/net/wireless/atmel.c	Thu Dec 11 01:49:39 2003
+++ b/drivers/net/wireless/atmel.c	Thu Dec 11 01:49:39 2003
@@ -748,13 +748,13 @@
 	
 	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 @@
 	
 	spin_unlock_irqrestore(&priv->irqlock, flags);
 	spin_unlock_bh(&priv->timerlock);
+
+done:
 	dev_kfree_skb(skb);
 	
 	return 0;	
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux