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>
This commit is contained in:
Tom Rix 2021-12-18 07:27:12 -08:00 committed by Bartosz Golaszewski
parent 6dbe6c07f9
commit c08995bff2

View File

@ -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;
}