gpiolib: Fix return value of gpio_to_desc() stub if !GPIOLIB

commit c5510b8daf upstream.

If CONFIG_GPOILIB is not set, the stub of gpio_to_desc() should return
the same type of error as regular version: NULL.  All the callers
compare the return value of gpio_to_desc() against NULL, so returned
ERR_PTR would be treated as non-error case leading to dereferencing of
error value.

Fixes: 79a9becda8 ("gpiolib: export descriptor-based GPIO interface")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
This commit is contained in:
Krzysztof Kozlowski 2018-12-06 10:45:49 +01:00 • committed by Ben Hutchings
commit a3777d9caf