diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index aa7039dfa19d357b113e66262fe55f7f1ad8cd84..7a560b785097e2971aa916d73c2ea2b72107cb8d 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c @@ -501,17 +501,15 @@ static struct class rfkill_class = { static int rfkill_add_switch(struct rfkill *rfkill) { - int error; - mutex_lock(&rfkill_mutex); - error = rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0); - if (!error) - list_add_tail(&rfkill->node, &rfkill_list); + rfkill_toggle_radio(rfkill, rfkill_states[rfkill->type], 0); + + list_add_tail(&rfkill->node, &rfkill_list); mutex_unlock(&rfkill_mutex); - return error; + return 0; } static void rfkill_remove_switch(struct rfkill *rfkill)