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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux