diff mbox

mac80211: silence NULL dereference warning

Message ID 20121127173119.GC1059@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Nov. 27, 2012, 5:31 p.m. UTC
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.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Johannes Berg Nov. 28, 2012, 12:45 p.m. UTC | #1
On Tue, 2012-11-27 at 20:31 +0300, Dan Carpenter wrote:
> 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index ec15a49..d923058 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -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;
 		}
 	}