aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@nokia.com>2010-12-21 20:24:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-22 22:43:33 -0500
commite254811c205ec539b648cff54a7852ee8dcd2e5e (patch)
treeae6a382b424192053dbc1de6a9ee818262e1966b /drivers/gpio
parentd153ba64450b9371158c6516d6cac120faace44c (diff)
gpiolib: gpio_request_one(): add missing gpio_free()
If GPIO request succeeds, but configuration fails, it should be released. Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com> Acked-by: Eric Miao <eric.miao@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpiolib.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 21da9c19a0cb..649550e2cae9 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1281,6 +1281,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
1281 err = gpio_direction_output(gpio, 1281 err = gpio_direction_output(gpio,
1282 (flags & GPIOF_INIT_HIGH) ? 1 : 0); 1282 (flags & GPIOF_INIT_HIGH) ? 1 : 0);
1283 1283
1284 if (err)
1285 gpio_free(gpio);
1286
1284 return err; 1287 return err;
1285} 1288}
1286EXPORT_SYMBOL_GPL(gpio_request_one); 1289EXPORT_SYMBOL_GPL(gpio_request_one);