9
0
Fork 0

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>
This commit is contained in:
Antony Pavlov 2014-01-09 21:58:38 +04:00 committed by Sascha Hauer
parent f8cdb92751
commit 4fcad5129e
1 changed files with 1 additions and 0 deletions

View File

@ -94,6 +94,7 @@ void gpio_free(unsigned gpio)
gi->requested = false;
free(gi->label);
gi->label = NULL;
}
/**