diff options
author | Mark Brown <broonie@kernel.org> | 2018-12-11 23:44:49 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-12-11 23:44:49 +0300 |
commit | e6202e8249aa7115af65f2d80b43c132816224ef (patch) | |
tree | 8865dd722ad55bb5e6bd5d446057395336ed0169 /drivers/gpio/gpiolib.c | |
parent | 2b96edb570709d6ca2e06842941c4bdf04b55f47 (diff) | |
parent | d407c81adae57041ba82577e604e351f36b8afce (diff) | |
download | linux-e6202e8249aa7115af65f2d80b43c132816224ef.tar.xz |
Merge branch 'for-linus' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-4.21
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index a7e3fd512e2d..985c09ce80fb 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -1295,7 +1295,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *chip, void *data, gdev->descs = kcalloc(chip->ngpio, sizeof(gdev->descs[0]), GFP_KERNEL); if (!gdev->descs) { status = -ENOMEM; - goto err_free_gdev; + goto err_free_ida; } if (chip->ngpio == 0) { @@ -1427,8 +1427,9 @@ err_free_label: kfree_const(gdev->label); err_free_descs: kfree(gdev->descs); -err_free_gdev: +err_free_ida: ida_simple_remove(&gpio_ida, gdev->id); +err_free_gdev: /* failures here can mean systems won't boot... */ pr_err("%s: GPIOs %d..%d (%s) failed to register, %d\n", __func__, gdev->base, gdev->base + gdev->ngpio - 1, |