Search Linux Wireless

rt2x00: Only free skb when beacon_update fails

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

 



In rt2x00lib_intf_scheduled_iter() we use the hw->beacon_update()
callback function. This means that it should behave similarly as mac80211
when that uses the function.

This means that the skb should only be freed when beacon_update() has failed,
otherwise the driver is the owner and is responsible for freeing the buffer.

Signed-off-by: Ivo van Doorn <IvDoorn@xxxxxxxxx>
---
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 0361524..f8fe7a1 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -433,11 +433,9 @@ static void rt2x00lib_intf_scheduled_iter(void *data, u8 *mac,
 
 	if (delayed_flags & DELAYED_UPDATE_BEACON) {
 		skb = ieee80211_beacon_get(rt2x00dev->hw, vif, &control);
-		if (skb) {
-			rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw, skb,
-							  &control);
+		if (skb && rt2x00dev->ops->hw->beacon_update(rt2x00dev->hw,
+							     skb, &control))
 			dev_kfree_skb(skb);
-		}
 	}
 
 	if (delayed_flags & DELAYED_CONFIG_ERP)
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux