diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2019-12-04 09:56:42 +0200 |
---|---|---|
committer | Pavel <pavel@ucw.cz> | 2019-12-21 20:09:47 +0100 |
commit | 9f4b952d0bfb7efffb7e85797efa5322e7e69dc5 (patch) | |
tree | 6a2b3855b663763c7fc5ffdaa389276b213fbeaa /drivers/leds | |
parent | 8e8d699b051f9ef86e31fb24569ccf3d869b54c4 (diff) | |
download | linux-9f4b952d0bfb7efffb7e85797efa5322e7e69dc5.tar.gz linux-9f4b952d0bfb7efffb7e85797efa5322e7e69dc5.tar.bz2 linux-9f4b952d0bfb7efffb7e85797efa5322e7e69dc5.zip |
leds-as3645a: Drop fwnode reference on ignored node
If a node is ignored, do not get a reference to it. Fix the bug by moving
fwnode_handle_get() where a reference to an fwnode is saved for clarity.
Reported-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-as3645a.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c index b7e0ae1af8fa..e8922fa03379 100644 --- a/drivers/leds/leds-as3645a.c +++ b/drivers/leds/leds-as3645a.c @@ -493,16 +493,17 @@ static int as3645a_parse_node(struct as3645a *flash, switch (id) { case AS_LED_FLASH: flash->flash_node = child; + fwnode_handle_get(child); break; case AS_LED_INDICATOR: flash->indicator_node = child; + fwnode_handle_get(child); break; default: dev_warn(&flash->client->dev, "unknown LED %u encountered, ignoring\n", id); break; } - fwnode_handle_get(child); } if (!flash->flash_node) { |