提交 632041f3 编写于 作者: E Eric Paris 提交者: David S. Miller

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: NEric Paris <eparis@redhat.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 a7da60f4
...@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill) ...@@ -392,11 +392,14 @@ int rfkill_register(struct rfkill *rfkill)
rfkill_led_trigger_register(rfkill); rfkill_led_trigger_register(rfkill);
error = rfkill_add_switch(rfkill); error = rfkill_add_switch(rfkill);
if (error) if (error) {
rfkill_led_trigger_unregister(rfkill);
return error; return error;
}
error = device_add(dev); error = device_add(dev);
if (error) { if (error) {
rfkill_led_trigger_unregister(rfkill);
rfkill_remove_switch(rfkill); rfkill_remove_switch(rfkill);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册