Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1946a2c3 authored by Michael Buesch's avatar Michael Buesch Committed by David S. Miller
Browse files

b43: Fix rfkill allocation leakage in error paths



We must kill rfkill in any error paths that trigger after rfkill init.

Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be9b7259
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -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;
}