aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-01-23 06:15:38 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-31 22:26:36 -0500
commit8712f2769dd66d8e7ff179d525b93e0a15a5b963 (patch)
tree4ee4da5b50a2b21d146b2435d593a88132b2cd0e /drivers/net
parent1946a2c3c6d138f0e1face8734226d9ba090e831 (diff)
b43legacy: 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> Acked-by: Stefano Brivio <stefano.brivio@polimi.it> 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/b43legacy/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 4ed4243feeaa..b9a046ff6dc6 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3221,6 +3221,7 @@ static int b43legacy_op_start(struct ieee80211_hw *hw)
3221 struct b43legacy_wldev *dev = wl->current_dev; 3221 struct b43legacy_wldev *dev = wl->current_dev;
3222 int did_init = 0; 3222 int did_init = 0;
3223 int err = 0; 3223 int err = 0;
3224 bool do_rfkill_exit = 0;
3224 3225
3225 /* First register RFkill. 3226 /* First register RFkill.
3226 * LEDs that are registered later depend on it. */ 3227 * LEDs that are registered later depend on it. */
@@ -3230,8 +3231,10 @@ static int b43legacy_op_start(struct ieee80211_hw *hw)
3230 3231
3231 if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) { 3232 if (b43legacy_status(dev) < B43legacy_STAT_INITIALIZED) {
3232 err = b43legacy_wireless_core_init(dev); 3233 err = b43legacy_wireless_core_init(dev);
3233 if (err) 3234 if (err) {
3235 do_rfkill_exit = 1;
3234 goto out_mutex_unlock; 3236 goto out_mutex_unlock;
3237 }
3235 did_init = 1; 3238 did_init = 1;
3236 } 3239 }
3237 3240
@@ -3240,6 +3243,7 @@ static int b43legacy_op_start(struct ieee80211_hw *hw)
3240 if (err) { 3243 if (err) {
3241 if (did_init) 3244 if (did_init)
3242 b43legacy_wireless_core_exit(dev); 3245 b43legacy_wireless_core_exit(dev);
3246 do_rfkill_exit = 1;
3243 goto out_mutex_unlock; 3247 goto out_mutex_unlock;
3244 } 3248 }
3245 } 3249 }
@@ -3247,6 +3251,9 @@ static int b43legacy_op_start(struct ieee80211_hw *hw)
3247out_mutex_unlock: 3251out_mutex_unlock:
3248 mutex_unlock(&wl->mutex); 3252 mutex_unlock(&wl->mutex);
3249 3253
3254 if (do_rfkill_exit)
3255 b43legacy_rfkill_exit(dev);
3256
3250 return err; 3257 return err;
3251} 3258}
3252 3259