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:
parent
f8cdb92751
commit
4fcad5129e
|
@ -94,6 +94,7 @@ void gpio_free(unsigned gpio)
|
|||
|
||||
gi->requested = false;
|
||||
free(gi->label);
|
||||
gi->label = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue