summaryrefslogtreecommitdiff
path: root/drivers/input/keyboard/cap11xx.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-13 08:30:07 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-13 08:30:07 +0100
commite2d6f8a5f596b1f09839990b11a3c2e0c9f0dbc2 (patch)
tree7ccf35788cbb9def996204399f079366da251361 /drivers/input/keyboard/cap11xx.c
parentfed0764fafd8e2e629a033c0f7df4106b0dcb7f0 (diff)
parent0cbb0b92689a1c4e0ac55f6188be563a813ac808 (diff)
Merge branch 'linus' into locking/core, to resolve conflicts
Conflicts: kernel/locking/lockdep.c Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/input/keyboard/cap11xx.c')
-rw-r--r--drivers/input/keyboard/cap11xx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 378db10001df..4401be225d64 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -304,8 +304,10 @@ static int cap11xx_init_leds(struct device *dev,
led->cdev.brightness = LED_OFF;
error = of_property_read_u32(child, "reg", &reg);
- if (error != 0 || reg >= num_leds)
+ if (error != 0 || reg >= num_leds) {
+ of_node_put(child);
return -EINVAL;
+ }
led->reg = reg;
led->priv = priv;
@@ -313,8 +315,10 @@ static int cap11xx_init_leds(struct device *dev,
INIT_WORK(&led->work, cap11xx_led_work);
error = devm_led_classdev_register(dev, &led->cdev);
- if (error)
+ if (error) {
+ of_node_put(child);
return error;
+ }
priv->num_leds++;
led++;