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>
This commit is contained in:
Alan Jenkins 2009-12-03 07:44:58 +00:00 committed by Len Brown
parent 2b56f1c170
commit dc56ad9b49

View file

@ -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;
}