Skip to content

Commit

Permalink
eeepc-laptop: fix potential leak (led_init() failure)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Jenkins authored and Len Brown committed Dec 9, 2009
1 parent 2b56f1c commit dc56ad9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/platform/x86/eeepc-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit dc56ad9

Please sign in to comment.