diff options
author | Teemu Paasikivi <ext-teemu.3.paasikivi@nokia.com> | 2010-09-24 00:23:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-27 15:57:47 -0400 |
commit | 92e44948b2b3b2db8f39f17033f98ae2356156a5 (patch) | |
tree | fd617ba0a5d939cbe03cfb579ee3e39c46fe2255 /net/wireless | |
parent | 56af326830757f3e8a1742770d15dfd6e3c40e85 (diff) |
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 <ext-teemu.3.paasikivi@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) | |||
4990 | 4990 | ||
4991 | err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); | 4991 | err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); |
4992 | if (err) | 4992 | if (err) |
4993 | goto unlock_rdev; | 4993 | goto unlock_rtnl; |
4994 | 4994 | ||
4995 | wdev = dev->ieee80211_ptr; | 4995 | wdev = dev->ieee80211_ptr; |
4996 | 4996 | ||
@@ -5014,6 +5014,7 @@ static int nl80211_set_power_save(struct sk_buff *skb, struct genl_info *info) | |||
5014 | unlock_rdev: | 5014 | unlock_rdev: |
5015 | cfg80211_unlock_rdev(rdev); | 5015 | cfg80211_unlock_rdev(rdev); |
5016 | dev_put(dev); | 5016 | dev_put(dev); |
5017 | unlock_rtnl: | ||
5017 | rtnl_unlock(); | 5018 | rtnl_unlock(); |
5018 | 5019 | ||
5019 | out: | 5020 | out: |