aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-01-23 06:02:35 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:35 -0500
commit1946a2c3c6d138f0e1face8734226d9ba090e831 (patch)
tree066a7856f2c1806083776e6a3914ddf0c2d20c91 /drivers/net
parentbe9b72590c05daf34c2b55cd5b7c68375a4a795b (diff)
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')
-rw-r--r--drivers/net/wireless/b43/main.c9
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)
3630 struct b43_wldev *dev = wl->current_dev; 3630 struct b43_wldev *dev = wl->current_dev;
3631 int did_init = 0; 3631 int did_init = 0;
3632 int err = 0; 3632 int err = 0;
3633 bool do_rfkill_exit = 0;
3633 3634
3634 /* First register RFkill. 3635 /* First register RFkill.
3635 * LEDs that are registered later depend on it. */ 3636 * LEDs that are registered later depend on it. */
@@ -3639,8 +3640,10 @@ static int b43_op_start(struct ieee80211_hw *hw)
3639 3640
3640 if (b43_status(dev) < B43_STAT_INITIALIZED) { 3641 if (b43_status(dev) < B43_STAT_INITIALIZED) {
3641 err = b43_wireless_core_init(dev); 3642 err = b43_wireless_core_init(dev);
3642 if (err) 3643 if (err) {
3644 do_rfkill_exit = 1;
3643 goto out_mutex_unlock; 3645 goto out_mutex_unlock;
3646 }
3644 did_init = 1; 3647 did_init = 1;
3645 } 3648 }
3646 3649
@@ -3649,6 +3652,7 @@ static int b43_op_start(struct ieee80211_hw *hw)
3649 if (err) { 3652 if (err) {
3650 if (did_init) 3653 if (did_init)
3651 b43_wireless_core_exit(dev); 3654 b43_wireless_core_exit(dev);
3655 do_rfkill_exit = 1;
3652 goto out_mutex_unlock; 3656 goto out_mutex_unlock;
3653 } 3657 }
3654 } 3658 }
@@ -3656,6 +3660,9 @@ static int b43_op_start(struct ieee80211_hw *hw)
3656 out_mutex_unlock: 3660 out_mutex_unlock:
3657 mutex_unlock(&wl->mutex); 3661 mutex_unlock(&wl->mutex);
3658 3662
3663 if (do_rfkill_exit)
3664 b43_rfkill_exit(dev);
3665
3659 return err; 3666 return err;
3660} 3667}
3661 3668