From: Teemu Paasikivi Date: Fri, 24 Sep 2010 04:23:55 +0000 (+0300) Subject: nl80211: Fix exit from nl80211_set_power_save X-Git-Tag: firefly_0821_release~7613^2~3670^2~265^2^2~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92e44948b2b3b2db8f39f17033f98ae2356156a5;p=firefly-linux-kernel-4.4.55.git nl80211: Fix exit from nl80211_set_power_save If interface does not existk, when nl80211_set_power_save is called, (eg. module has been unloaded) it has been causing kernel panic. Added new goto target to avoid crash if get_rdev_dev_by_info_ifindex does not return dev and rdev pointers. Signed-off-by: Teemu Paasikivi Signed-off-by: John W. Linville --- diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index f15b1af2c768..4ff827e8c362 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -4990,7 +4990,7 @@ static int nl80211_set_power_save(struct sk_buff *skb, struct genl_info *info) err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); if (err) - goto unlock_rdev; + goto unlock_rtnl; wdev = dev->ieee80211_ptr; @@ -5014,6 +5014,7 @@ static int nl80211_set_power_save(struct sk_buff *skb, struct genl_info *info) unlock_rdev: cfg80211_unlock_rdev(rdev); dev_put(dev); +unlock_rtnl: rtnl_unlock(); out: