summaryrefslogtreecommitdiff
path: root/drivers/platform/x86/eeepc-laptop.c
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2009-12-03 07:44:58 +0000
committerLen Brown <len.brown@intel.com>2009-12-09 15:54:31 -0500
commitdc56ad9b49d20e38bb9745bf3beca84291b21a51 (patch)
tree32af0d1e1b852c8693fe15ad4f9f3d05ed63e5e2 /drivers/platform/x86/eeepc-laptop.c
parent2b56f1c170fc6338a7d907d6a7132669f9ccdf62 (diff)
downloadlwn-dc56ad9b49d20e38bb9745bf3beca84291b21a51.tar.gz
lwn-dc56ad9b49d20e38bb9745bf3beca84291b21a51.zip
eeepc-laptop: fix potential leak (led_init() failure)
If we bail out because we can't create the led class device, we need to ensure the led workqueue is cleaned up. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/platform/x86/eeepc-laptop.c')
-rw-r--r--drivers/platform/x86/eeepc-laptop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/eeepc-laptop.c b/drivers/platform/x86/eeepc-laptop.c
index ac45fafbb796..8b686b563ec0 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -1248,8 +1248,10 @@ static int eeepc_led_init(struct device *dev)
return -ENOMEM;
rv = led_classdev_register(dev, &tpd_led);
- if (rv)
+ if (rv) {
+ destroy_workqueue(led_workqueue);
return rv;
+ }
return 0;
}