Skip to contentSkip to conversation

mac80211: decrement ref count to netdev after launching mesh discovery

PATCH In review Brian Cavagnolo 2 participants 2 messages Jan 17, 2009 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: decrement ref count to netdev after launching mesh discovery

After launching mesh discovery in tx path, reference count was not being decremented. This was preventing module unload.

---
 net/mac80211/tx.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
net/mac80211/tx.c +4 -2
index a7392af..d0ae7f0 100644
@@ -1358,8 +1358,10 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		if (is_multicast_ether_addr(hdr->addr3))
 			memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
 		else
-			if (mesh_nexthop_lookup(skb, osdata))
-				return  0;
+			if (mesh_nexthop_lookup(skb, osdata)) {
+				dev_put(odev);
+				return 0;
+			}
 		if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
 			IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
 							    fwded_frames);
Signature · 1 line
1.5.5.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Brian Cavagnolo

After launching mesh discovery in tx path, reference count was not being decremented. This was preventing module unload.

Quoted 21 lines
---
 net/mac80211/tx.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
net/mac80211/tx.c +4 -2
index a7392af..d0ae7f0 100644
@@ -1358,8 +1358,10 @@ int ieee80211_master_start_xmit(struct sk_buff *skb, struct net_device *dev)
 		if (is_multicast_ether_addr(hdr->addr3))
 			memcpy(hdr->addr1, hdr->addr3, ETH_ALEN);
 		else
-			if (mesh_nexthop_lookup(skb, osdata))
-				return  0;
+			if (mesh_nexthop_lookup(skb, osdata)) {
+				dev_put(odev);
+				return 0;
+			}
 		if (memcmp(odev->dev_addr, hdr->addr4, ETH_ALEN) != 0)
 			IEEE80211_IFSTA_MESH_CTR_INC(&osdata->u.mesh,
 							    fwded_frames);