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

Commit 632041f3 authored by Eric Paris's avatar Eric Paris Committed by David S. Miller
Browse files

rfkill: call rfkill_led_trigger_unregister() on error



Code inspection turned up that error cases in rfkill_register() do not
call rfkill_led_trigger_unregister() even though we have already
registered.

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent a7da60f4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill)
	rfkill_led_trigger_register(rfkill);

	error = rfkill_add_switch(rfkill);
	if (error)
	if (error) {
		rfkill_led_trigger_unregister(rfkill);
		return error;
	}

	error = device_add(dev);
	if (error) {
		rfkill_led_trigger_unregister(rfkill);
		rfkill_remove_switch(rfkill);
		return error;
	}