diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2009-12-03 07:44:58 +0000 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-12-09 15:54:31 -0500 |
commit | dc56ad9b49d20e38bb9745bf3beca84291b21a51 (patch) | |
tree | 32af0d1e1b852c8693fe15ad4f9f3d05ed63e5e2 /drivers/platform/x86/eeepc-laptop.c | |
parent | 2b56f1c170fc6338a7d907d6a7132669f9ccdf62 (diff) | |
download | lwn-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.c | 4 |
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; } |