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