gpio: exar: Fix error return code in gpio_exar_probe()
Subsystems (2)
PATCH 1/1 gpio: exar: Fix error return code in gpio_exar_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 7ecced0934e5 ("gpio: exar: add a check for the return value of ida_simple_get fails")
Signed-off-by Wei Yongjun <[email protected]>
--- drivers/gpio/gpio-exar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpio-exar.c +3 -1
@@ -148,8 +148,10 @@ static int gpio_exar_probe(struct platform_device *pdev)mutex_init (&exar_gpio->lock); index =ida_simple_get (&ida_index,0 ,0 ,GFP_KERNEL ); -if (index <0 ) +if (index <0 ) { + ret = index; goto err_destroy; + }sprintf (exar_gpio->name,"exar_gpio%d" , index); exar_gpio->gpio_chip.label = exar_gpio->name;
śr., 6 maj 2020 o 14:39 Wei Yongjun <[email protected]> napisał(a):
Quoted 19 lines
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function.
Fixes 7ecced0934e5 ("gpio: exar: add a check for the return value of ida_simple_get fails")Signed-off-by Wei Yongjun <[email protected]>--- drivers/gpio/gpio-exar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpio/gpio-exar.c +0
-0@@ -148,8 +148,10 @@ static int gpio_exar_probe(struct platform_device *pdev)mutex_init (&exar_gpio->lock);
drivers/gpio/gpio-exar.c static int gpio_exar_probe(struct platform_device *pdev) · line 157
Quoted 10 lines
drivers/gpio/gpio-exar.c +3
-1index =ida_simple_get (&ida_index,0 ,0 ,GFP_KERNEL ); -if (index <0 ) +if (index <0 ) { + ret = index; goto err_destroy; + }sprintf (exar_gpio->name,"exar_gpio%d" , index); exar_gpio->gpio_chip.label = exar_gpio->name;
This is already fixed in my for-current branch.
Bart