All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] mac80211: silence NULL dereference warning
@ 2012-11-27 17:31 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-11-27 17:31 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, linux-wireless, kernel-janitors

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>

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;
 		}
 	}
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch] mac80211: silence NULL dereference warning
@ 2012-11-27 17:31 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2012-11-27 17:31 UTC (permalink / raw)
  To: John W. Linville; +Cc: Johannes Berg, linux-wireless, kernel-janitors

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>

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;
 		}
 	}
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch] mac80211: silence NULL dereference warning
  2012-11-27 17:31 ` Dan Carpenter
@ 2012-11-28 12:45   ` Johannes Berg
  -1 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-11-28 12:45 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: John W. Linville, linux-wireless, kernel-janitors

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch] mac80211: silence NULL dereference warning
@ 2012-11-28 12:45   ` Johannes Berg
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2012-11-28 12:45 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: John W. Linville, linux-wireless, kernel-janitors

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-28 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-27 17:31 [patch] mac80211: silence NULL dereference warning Dan Carpenter
2012-11-27 17:31 ` Dan Carpenter
2012-11-28 12:45 ` Johannes Berg
2012-11-28 12:45   ` Johannes Berg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.