Commit c2c3949c authored by Joe Hattori's avatar Joe Hattori Committed by Greg Kroah-Hartman
Browse files

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



[ Upstream commit 417cad5d ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 68834217
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment