From: Matthew Garrett Date: Mon, 1 Mar 2010 14:46:43 +0000 (-0500) Subject: dell-laptop: Fix errors on failure and exit paths X-Git-Tag: firefly_0821_release~9833^2~3043^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=92e00e47b61f558009ff81be42b412a76fd89d84;p=firefly-linux-kernel-4.4.55.git dell-laptop: Fix errors on failure and exit paths 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 Cc: Dmitry Torokhov --- diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 29d96a4f5769..ef614979afe9 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -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: @@ -597,12 +598,12 @@ fail_platform_driver: 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);