Skip to content

Commit

Permalink
dell-laptop: Fix errors on failure and exit paths
Browse files Browse the repository at this point in the history
Make sure that work is cancelled after removing the i8042 filter, and
unregister the platform device rather than deleting it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Matthew Garrett committed Mar 1, 2010
1 parent 94d8f78 commit 92e00e4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/platform/x86/dell-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,7 @@ static int __init dell_init(void)

fail_backlight:
i8042_remove_filter(dell_laptop_i8042_filter);
cancel_delayed_work_sync(&dell_rfkill_work);
fail_filter:
dell_cleanup_rfkill();
fail_rfkill:
Expand All @@ -597,12 +598,12 @@ static int __init dell_init(void)

static void __exit dell_exit(void)
{
cancel_delayed_work_sync(&dell_rfkill_work);
i8042_remove_filter(dell_laptop_i8042_filter);
cancel_delayed_work_sync(&dell_rfkill_work);
backlight_device_unregister(dell_backlight_device);
dell_cleanup_rfkill();
if (platform_device) {
platform_device_del(platform_device);
platform_device_unregister(platform_device);
platform_driver_unregister(&platform_driver);
}
kfree(da_tokens);
Expand Down

0 comments on commit 92e00e4

Please sign in to comment.