Skip to content

Commit

Permalink
nl80211: Fix exit from nl80211_set_power_save
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Teemu Paasikivi authored and John W. Linville committed Sep 27, 2010
1 parent 56af326 commit 92e4494
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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:
Expand Down

0 comments on commit 92e4494

Please sign in to comment.