All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cfg80211: fix a crash in dev lookup on dump commands
@ 2010-10-31 14:31 Felix Fietkau
  2010-10-31 15:17 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Felix Fietkau @ 2010-10-31 14:31 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Johannes Berg

IS_ERR and PTR_ERR were called with the wrong pointer, leading to a
crash when cfg80211_get_dev_from_ifindex fails.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
---
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -224,8 +224,8 @@ static int nl80211_prepare_netdev_dump(s
 	}
 
 	*rdev = cfg80211_get_dev_from_ifindex(sock_net(skb->sk), ifidx);
-	if (IS_ERR(dev)) {
-		err = PTR_ERR(dev);
+	if (IS_ERR(*rdev)) {
+		err = PTR_ERR(*rdev);
 		goto out_rtnl;
 	}
 


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

* Re: [PATCH] cfg80211: fix a crash in dev lookup on dump commands
  2010-10-31 14:31 [PATCH] cfg80211: fix a crash in dev lookup on dump commands Felix Fietkau
@ 2010-10-31 15:17 ` Johannes Berg
  0 siblings, 0 replies; 2+ messages in thread
From: Johannes Berg @ 2010-10-31 15:17 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless, John W. Linville

On Sun, 2010-10-31 at 15:31 +0100, Felix Fietkau wrote:
> IS_ERR and PTR_ERR were called with the wrong pointer, leading to a
> crash when cfg80211_get_dev_from_ifindex fails.

Good catch, thanks.

Acked-by: Johannes Berg <johannes@sipsolutions.net>

johannes


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

end of thread, other threads:[~2010-10-31 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-31 14:31 [PATCH] cfg80211: fix a crash in dev lookup on dump commands Felix Fietkau
2010-10-31 15:17 ` 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.