Commit c08995bf authored by Tom Rix's avatar Tom Rix Committed by Bartosz Golaszewski

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: default avatarTom Rix <trix@redhat.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent 6dbe6c07
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment