Re: [Patch 2/3] eeepc-laptop: Check return values from rfkill_register

From: Alan Jenkins
Date: Mon Nov 17 2008 - 10:09:33 EST


On 11/17/08, Matthew Garrett <mjg59@xxxxxxxxxxxxx> wrote:
> We should check that rfkill registration succeeds and error out if it
> doesn't. This patch also sets the default state to match the BIOS on
> load.
>
> Signed-off-by: Matthew Garrett <mjg@xxxxxxxxxx>
>
> diff --git a/drivers/misc/eeepc-laptop.c b/drivers/misc/eeepc-laptop.c

You change the usage of the "end" label so it's now only reached on
failure. How about renaming it to "fail" or "ehotk_fail"? Also, it
looks like "if (result)" is now redundant - result will always be
non-zero in the error path.

> + return 0;
>
> + bluetooth_fail:
> + if (ehotk->eeepc_bluetooth_rfkill)
> + rfkill_free(ehotk->eeepc_bluetooth_rfkill);
> + rfkill_unregister(ehotk->eeepc_wlan_rfkill);
> + ehotk->eeepc_wlan_rfkill = NULL;
> + wlan_fail:
> + if (ehotk->eeepc_wlan_rfkill)
> + rfkill_free(ehotk->eeepc_wlan_rfkill);
> end:
> if (result) {
> kfree(ehotk);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/