diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2019-03-28 14:13:47 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-05-04 09:15:22 +0200 |
commit | d23be337c71d9951d754c31f7c680a148535ea11 (patch) | |
tree | 3433bfa0cf8d4693c1b1fd20c6d32f70c58e0891 /scripts | |
parent | 6a56dc1e2087e013446e69f5a4879575036eb995 (diff) |
gpio: of: Fix of_gpiochip_add() error path
[ Upstream commit f7299d441a4da8a5088e651ea55023525a793a13 ]
If the call to of_gpiochip_scan_gpios() in of_gpiochip_add() fails, no
error handling is performed. This lead to the need of callers to call
of_gpiochip_remove() on failure, which causes "BAD of_node_put() on ..."
if the failure happened before the call to of_node_get().
Fix this by adding proper error handling.
Note that calling gpiochip_remove_pin_ranges() multiple times causes no
harm: subsequent calls are a no-op.
Fixes: dfbd379ba9b7431e ("gpio: of: Return error if gpio hog configuration failed")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sasha Levin (Microsoft) <sashal@kernel.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions