diff options
author | Michael Buesch <mb@bu3sch.de> | 2008-01-23 14:02:35 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-01 06:26:35 +0300 |
commit | 1946a2c3c6d138f0e1face8734226d9ba090e831 (patch) | |
tree | 066a7856f2c1806083776e6a3914ddf0c2d20c91 /drivers/net/wireless | |
parent | be9b72590c05daf34c2b55cd5b7c68375a4a795b (diff) | |
download | linux-1946a2c3c6d138f0e1face8734226d9ba090e831.tar.xz |
b43: Fix rfkill allocation leakage in error paths
We must kill rfkill in any error paths that trigger after rfkill init.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 88d2c15d3fbe..f21355da84bd 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -3630,6 +3630,7 @@ static int b43_op_start(struct ieee80211_hw *hw) struct b43_wldev *dev = wl->current_dev; int did_init = 0; int err = 0; + bool do_rfkill_exit = 0; /* First register RFkill. * LEDs that are registered later depend on it. */ @@ -3639,8 +3640,10 @@ static int b43_op_start(struct ieee80211_hw *hw) if (b43_status(dev) < B43_STAT_INITIALIZED) { err = b43_wireless_core_init(dev); - if (err) + if (err) { + do_rfkill_exit = 1; goto out_mutex_unlock; + } did_init = 1; } @@ -3649,6 +3652,7 @@ static int b43_op_start(struct ieee80211_hw *hw) if (err) { if (did_init) b43_wireless_core_exit(dev); + do_rfkill_exit = 1; goto out_mutex_unlock; } } @@ -3656,6 +3660,9 @@ static int b43_op_start(struct ieee80211_hw *hw) out_mutex_unlock: mutex_unlock(&wl->mutex); + if (do_rfkill_exit) + b43_rfkill_exit(dev); + return err; } |