From: Felix Fietkau Date: Sun, 31 Oct 2010 14:31:54 +0000 (+0100) Subject: cfg80211: fix a crash in dev lookup on dump commands X-Git-Tag: v2.6.37-rc2~20^2~23^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cc25e510dfc36dc62ee0aa87344b36ed7c1742a;p=platform%2Fkernel%2Flinux-exynos.git cfg80211: fix a crash in dev lookup on dump commands 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 Acked-by: Johannes Berg Signed-off-by: John W. Linville --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index c506241f8637..4e78e3f26798 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -224,8 +224,8 @@ static int nl80211_prepare_netdev_dump(struct sk_buff *skb, } *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; }