dell-laptop: fix rfkill memory leak on unload and failure paths
rfkill_unregister() should always be followed by rfkill_destroy(). Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Acked-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
71e9dc73cb
commit
4311bb230e
@ -268,6 +268,22 @@ err_wifi:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void dell_cleanup_rfkill(void)
|
||||||
|
{
|
||||||
|
if (wifi_rfkill) {
|
||||||
|
rfkill_unregister(wifi_rfkill);
|
||||||
|
rfkill_destroy(wifi_rfkill);
|
||||||
|
}
|
||||||
|
if (bluetooth_rfkill) {
|
||||||
|
rfkill_unregister(bluetooth_rfkill);
|
||||||
|
rfkill_destroy(bluetooth_rfkill);
|
||||||
|
}
|
||||||
|
if (wwan_rfkill) {
|
||||||
|
rfkill_unregister(wwan_rfkill);
|
||||||
|
rfkill_destroy(wwan_rfkill);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int dell_send_intensity(struct backlight_device *bd)
|
static int dell_send_intensity(struct backlight_device *bd)
|
||||||
{
|
{
|
||||||
struct calling_interface_buffer buffer;
|
struct calling_interface_buffer buffer;
|
||||||
@ -370,12 +386,7 @@ static int __init dell_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
fail_backlight:
|
fail_backlight:
|
||||||
if (wifi_rfkill)
|
dell_cleanup_rfkill();
|
||||||
rfkill_unregister(wifi_rfkill);
|
|
||||||
if (bluetooth_rfkill)
|
|
||||||
rfkill_unregister(bluetooth_rfkill);
|
|
||||||
if (wwan_rfkill)
|
|
||||||
rfkill_unregister(wwan_rfkill);
|
|
||||||
fail_rfkill:
|
fail_rfkill:
|
||||||
kfree(da_tokens);
|
kfree(da_tokens);
|
||||||
return ret;
|
return ret;
|
||||||
@ -384,12 +395,7 @@ fail_rfkill:
|
|||||||
static void __exit dell_exit(void)
|
static void __exit dell_exit(void)
|
||||||
{
|
{
|
||||||
backlight_device_unregister(dell_backlight_device);
|
backlight_device_unregister(dell_backlight_device);
|
||||||
if (wifi_rfkill)
|
dell_cleanup_rfkill();
|
||||||
rfkill_unregister(wifi_rfkill);
|
|
||||||
if (bluetooth_rfkill)
|
|
||||||
rfkill_unregister(bluetooth_rfkill);
|
|
||||||
if (wwan_rfkill)
|
|
||||||
rfkill_unregister(wwan_rfkill);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(dell_init);
|
module_init(dell_init);
|
||||||
|
Loading…
Reference in New Issue
Block a user