From: Andrew Morton Date: Wed, 4 Feb 2009 23:12:07 +0000 (-0800) Subject: hp-wmi: fix error path in hp_wmi_bios_setup() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=44f0606d52d98ff05b3b62bb694821857e36819d;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git hp-wmi: fix error path in hp_wmi_bios_setup() The error-path code can call rfkill_unregister() with a pointer which does not contain the result of a call to rfkill_register(). It goes BUG(). Addresses http://bugzilla.kernel.org/show_bug.cgi?id=12560. Cc: Frans Pop Cc: Larry Finger Cc: Len Brown Acked-by: Matthew Garrett Reported-by: Helge Deller Testted-by: Helge Deller Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index de91ddab0a86..f41135f2fb29 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c @@ -463,9 +463,11 @@ static int __init hp_wmi_bios_setup(struct platform_device *device) return 0; register_wwan_err: - rfkill_unregister(bluetooth_rfkill); + if (bluetooth_rfkill) + rfkill_unregister(bluetooth_rfkill); register_bluetooth_error: - rfkill_unregister(wifi_rfkill); + if (wifi_rfkill) + rfkill_unregister(wifi_rfkill); add_sysfs_error: cleanup_sysfs(device); return err;