gpio: exar: add a check for the return value of ida_simple_get fails
authorKangjie Lu <kjlu@umn.edu>
Sat, 9 Mar 2019 04:07:57 +0000 (22:07 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Apr 2019 04:25:19 +0000 (06:25 +0200)
commite708e5db25085d42481dfc8da49cac67e3b103b2
treef6d92df7fc9d4af1f60c47ac72bdfe74fff1b614
parent2ea1c197bfbd166723c788f3e346265b3f8f27c0
gpio: exar: add a check for the return value of ida_simple_get fails

commit 7ecced0934e574b528a1ba6c237731e682216a74 upstream.

ida_simple_get may fail and return a negative error number.
The fix checks its return value; if it fails, go to err_destroy.

Cc: <stable@vger.kernel.org>
Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpio/gpio-exar.c