Skip to content

Commit

Permalink
hp-wmi: fix error path in hp_wmi_bios_setup()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Larry Finger <[email protected]>
Cc: Len Brown <[email protected]>
Acked-by: Matthew Garrett <[email protected]>
Reported-by: Helge Deller <[email protected]>
Testted-by: Helge Deller <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
akpm00 authored and torvalds committed Feb 5, 2009
1 parent 60fd760 commit 44f0606
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/platform/x86/hp-wmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 44f0606

Please sign in to comment.