hp-wmi: fix error path in hp_wmi_bios_setup()
[linux-2.6-block.git] / drivers / platform / x86 / hp-wmi.c
index de91ddab0a86091fc353938125b04a69893c8554..f41135f2fb299dea3efbd6cc68a6479ce7a5002a 100644 (file)
@@ -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;