summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-turris-omnia.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/leds/leds-turris-omnia.c')
-rw-r--r--drivers/leds/leds-turris-omnia.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index ea7da8517220..117976cf75c8 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -236,8 +236,10 @@ static int omnia_leds_probe(struct i2c_client *client,
led = &leds->leds[0];
for_each_available_child_of_node(np, child) {
ret = omnia_led_register(client, led, child);
- if (ret < 0)
+ if (ret < 0) {
+ of_node_put(child);
return ret;
+ }
led += ret;
}