Skip to content
Commit 417cad5d authored by Joe Hattori's avatar Joe Hattori Committed by Lee Jones
Browse files

leds: cht-wcove: Use devm_led_classdev_register() to avoid memory leak



cht_wc_leds_probe() leaks memory when the second led_classdev_register()
call in the for-loop fails as it does not call the cleanup function
led_classdev_unregister() on the first device. Avoid this leak by
calling devm_led_classdev_register().

Fixes: 047da762 ("leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver")
Signed-off-by: default avatarJoe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20241220085346.533675-1-joe@pf.is.s.u-tokyo.ac.jp


Signed-off-by: default avatarLee Jones <lee@kernel.org>
parent e14d8792
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment