mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 19:40:52 +07:00
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>
This commit is contained in:
parent
90a8e82d3c
commit
22cb0a76e0
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user