projects
/
profile
/
common
/
kernel-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d153ba6
)
gpiolib: gpio_request_one(): add missing gpio_free()
author
Aaro Koskinen
<aaro.koskinen@nokia.com>
Wed, 22 Dec 2010 01:24:22 +0000
(17:24 -0800)
committer
Linus Torvalds
<torvalds@linux-foundation.org>
Thu, 23 Dec 2010 03:43:33 +0000
(19:43 -0800)
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>
drivers/gpio/gpiolib.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpiolib.c
b/drivers/gpio/gpiolib.c
index
21da9c1
..
649550e
100644
(file)
--- 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)
err = gpio_direction_output(gpio,
(flags & GPIOF_INIT_HIGH) ? 1 : 0);
+ if (err)
+ gpio_free(gpio);
+
return err;
}
EXPORT_SYMBOL_GPL(gpio_request_one);