diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2009-08-19 16:06:47 +0200 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-10 05:59:19 +0100 |
commit | 71e9dc73cb6b1351bdd5f732cef5dbef411b3219 (patch) | |
tree | 968d57bf56ec08bfd82b600caf53626d02166990 /drivers | |
parent | dell-laptop: Fix rfkill state queries (diff) | |
download | linux-71e9dc73cb6b1351bdd5f732cef5dbef411b3219.tar.xz linux-71e9dc73cb6b1351bdd5f732cef5dbef411b3219.zip |
dell-laptop: fix a use-after-free error on the failure path
dell_setup_rfkill() already cleans up the rfkill devices on failure.
So if it returns an error, we should not try to unregister the rfkill
devices.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/platform/x86/dell-laptop.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index 906111152b03..d791ef93c1f0 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c @@ -330,7 +330,7 @@ static int __init dell_init(void) if (ret) { printk(KERN_WARNING "dell-laptop: Unable to setup rfkill\n"); - goto out; + goto fail_rfkill; } #ifdef CONFIG_ACPI @@ -358,7 +358,7 @@ static int __init dell_init(void) if (IS_ERR(dell_backlight_device)) { ret = PTR_ERR(dell_backlight_device); dell_backlight_device = NULL; - goto out; + goto fail_backlight; } dell_backlight_device->props.max_brightness = max_intensity; @@ -368,13 +368,15 @@ static int __init dell_init(void) } return 0; -out: + +fail_backlight: if (wifi_rfkill) rfkill_unregister(wifi_rfkill); if (bluetooth_rfkill) rfkill_unregister(bluetooth_rfkill); if (wwan_rfkill) rfkill_unregister(wwan_rfkill); +fail_rfkill: kfree(da_tokens); return ret; } |