Skip to content
Commit 5391dd0a authored by Dan Carpenter's avatar Dan Carpenter Committed by Bryan Wu
Browse files

leds-lp5523: BUG() in error handling in probe()



Inside the error handling in lp5523_init_led(), there is a place that
calls to led_classdev_unregister().  When we unregister the LED drivers,
it tries to set the brightness to OFF.  In this driver setting the
brightness is done through a work queue and the work queue hasn't been
initialized yet.

The result is that we trigger a WARN_ON() in the __queue_work().

The fix is to move the INIT_WORK() in front of the call to
lp5523_init_led().

Matt Renzelmann found this using a bug finding tool.

Reported-by: default avatarMatt Renzelmann <mjr@cs.wisc.edu>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent 32abb478
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment