gpiolib: check descriptors validity before use
authorAlexandre Courbot <acourbot@nvidia.com>
Fri, 15 Feb 2013 05:46:14 +0000 (14:46 +0900)
committerGrant Likely <grant.likely@secretlab.ca>
Sat, 2 Mar 2013 13:20:19 +0000 (13:20 +0000)
Some functions dereferenced their GPIO descriptor argument without
checking its validity first, potentially leading to an oops when given
an invalid argument.

This patch also makes gpio_get_value() more resilient when given an
invalid GPIO, returning 0 instead of silently crashing.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

No differences found