summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-exar.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2020-06-08 10:14:49 -0700
committerTony Lindgren <tony@atomide.com>2020-06-08 10:14:49 -0700
commit4263eb6880df8383fff0efb872278a99eb6142c8 (patch)
tree67ab9bf228e4f5f341f9408e055180932b39fe06 /drivers/gpio/gpio-exar.c
parent636338d7968e47c7f2e0b772a2a825ad932883fb (diff)
parent8e326a8bdef3fb42b92bf2742e8405d9b9209367 (diff)
Merge branch 'fixes-v5.7' into fixes
Diffstat (limited to 'drivers/gpio/gpio-exar.c')
-rw-r--r--drivers/gpio/gpio-exar.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index da1ef0b1c291..b1accfba017d 100644
--- a/drivers/gpio/gpio-exar.c
+++ b/drivers/gpio/gpio-exar.c
@@ -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)
- goto err_destroy;
+ if (index < 0) {
+ ret = index;
+ goto err_mutex_destroy;
+ }
sprintf(exar_gpio->name, "exar_gpio%d", index);
exar_gpio->gpio_chip.label = exar_gpio->name;
@@ -176,6 +178,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
err_destroy:
ida_simple_remove(&ida_index, index);
+err_mutex_destroy:
mutex_destroy(&exar_gpio->lock);
return ret;
}