Skip to contentSkip to conversation

mac80211: silence NULL dereference warning

PATCH In review Dan Carpenter 2 participants 2 messages Nov 27, 2012 – Nov 28, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mac80211: silence NULL dereference warning

Smatch complains that we could dereference skb later in the function. It's probably unlikely, but we may as well return here and avoid it.

net/mac80211/rx.c +1 -1
index ec15a49..d923058 100644
@@ -49,7 +49,7 @@ static struct sk_buff *remove_monitor_info(struct ieee80211_local *local,
 			/* driver bug */
 			WARN_ON(1);
 			dev_kfree_skb(skb);
-			skb = NULL;
+			return NULL;
 		}
 	}
 
maintainer
#1 lore raw
Quoted 2 lines · Dan Carpenter

Smatch complains that we could dereference skb later in the function. It's probably unlikely, but we may as well return here and avoid it.

Good catch, applied.

johannes