diff options
author | Hans de Goede <[email protected]> | 2023-01-20 12:45:14 +0100 |
---|---|---|
committer | Lee Jones <[email protected]> | 2023-01-27 11:06:03 +0000 |
commit | 445110941eb94709216363f9d807d2508e64abd7 (patch) | |
tree | fec469c845f20b01dc2b926fbcf705066e928d8d /tools/testing/selftests/bpf/progs/test_prog_array_init.c | |
parent | 1b929c02afd37871d5afb9d498426f83432e71c2 (diff) |
leds: led-class: Add missing put_device() to led_put()
led_put() is used to "undo" a successful of_led_get() call,
of_led_get() uses class_find_device_by_of_node() which returns
a reference to the device which must be free-ed with put_device()
when the caller is done with it.
Add a put_device() call to led_put() to free the reference returned
by class_find_device_by_of_node().
And also add a put_device() in the error-exit case of try_module_get()
failing.
Fixes: 699a8c7c4bd3 ("leds: Add of_led_get() and led_put()")
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Signed-off-by: Lee Jones <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_prog_array_init.c')
0 files changed, 0 insertions, 0 deletions