diff options
author | Antony Pavlov <antonynpavlov@gmail.com> | 2014-01-09 21:58:38 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-01-10 10:09:31 +0100 |
commit | 4fcad5129e73cf87032082f592bccb79181e0799 (patch) | |
tree | c15572083912ad2c51af8381d0431de94f9dbc21 /drivers/gpio | |
parent | f8cdb92751c6508e4ba1cb4d4ad8baee5cd2ab2e (diff) | |
download | barebox-4fcad5129e73cf87032082f592bccb79181e0799.tar.gz barebox-4fcad5129e73cf87032082f592bccb79181e0799.tar.xz |
gpiolib: gpio_free: clear gpio's "label" field too
If an error occured during gpio_request_array() then we can
get not requested gpio with nonempty garbage "label" field
value. Afterward the "gpiolib" command can try to use this
nonempty garbage value.
This patch prevents this error situation.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpiolib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index b7430b01ac..5f13d5f231 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -94,6 +94,7 @@ void gpio_free(unsigned gpio) gi->requested = false; free(gi->label); + gi->label = NULL; } /** |