diff options
author | Tom Rix <trix@redhat.com> | 2021-12-18 16:27:12 +0100 |
---|---|---|
committer | Bartosz Golaszewski <brgl@bgdev.pl> | 2021-12-19 14:47:30 +0100 |
commit | c08995bff202f102c0eff7b799b6b91b748a02a2 (patch) | |
tree | fc373967e87dcbc7e79b06a5a1b7c275d0786455 /drivers/gpio/gpio-sim.c | |
parent | gpio: Propagate firmware node from a parent device (diff) | |
download | linux-c08995bff202f102c0eff7b799b6b91b748a02a2.tar.xz linux-c08995bff202f102c0eff7b799b6b91b748a02a2.zip |
gpio: sim: fix uninitialized ret variable
Building with clang returns this error:
gpio-sim.c:889:7: error: variable 'ret' is uninitialized
when used here
ret should be the status of the call to
gpio_sim_make_bank_swnode stored in bank->swnode.
Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Signed-off-by: Tom Rix <trix@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Diffstat (limited to 'drivers/gpio/gpio-sim.c')
-rw-r--r-- | drivers/gpio/gpio-sim.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c index ef6145f51c8a..bef00dcc4dc8 100644 --- a/drivers/gpio/gpio-sim.c +++ b/drivers/gpio/gpio-sim.c @@ -886,7 +886,8 @@ static int gpio_sim_device_activate_unlocked(struct gpio_sim_device *dev) list_for_each_entry(bank, &dev->bank_list, siblings) { bank->swnode = gpio_sim_make_bank_swnode(bank, swnode); - if (ret) { + if (IS_ERR(bank->swnode)) { + ret = PTR_ERR(bank->swnode); gpio_sim_remove_swnode_recursive(swnode); return ret; } |