On Thu, Jan 19, 2023 at 2:01 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote: > 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. > > Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx> Reviewed-by: Linus Walleij <linus.walleij@xxxxxxxxxx> Yours, Linus Walleij