summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-max732x.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-03-06 10:31:15 +0100
committerLinus Walleij <linus.walleij@linaro.org>2014-03-12 14:48:13 +0100
commitc75793d8ab743acdd07120cf11c0242daea8f780 (patch)
treee8156d955633a2b6c5115a9c4195028479c10f9c /drivers/gpio/gpio-max732x.c
parentdevicetree: bindings: gpio-davinic: fix documentation (diff)
downloadlinux-c75793d8ab743acdd07120cf11c0242daea8f780.tar.xz
linux-c75793d8ab743acdd07120cf11c0242daea8f780.zip
gpio: max732x: Fix I2C dummy device resource leak on probe failure
In max732x_probe() driver allocates dummy I2C device (if number of ports is greater than 8) however it is not unregistered if probe fails later. Fix the leak by unregistering dummy I2C device if it was allocated. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-max732x.c')
-rw-r--r--drivers/gpio/gpio-max732x.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c
index 36cb290764b6..74432daaf656 100644
--- a/drivers/gpio/gpio-max732x.c
+++ b/drivers/gpio/gpio-max732x.c
@@ -647,6 +647,8 @@ static int max732x_probe(struct i2c_client *client,
return 0;
out_failed:
+ if (chip->client_dummy)
+ i2c_unregister_device(chip->client_dummy);
max732x_irq_teardown(chip);
return ret;
}