]> git.openfabrics.org - ~shefty/rdma-dev.git/blobdiff - drivers/gpio/gpiolib.c
gpiolib: gpio_request_one(): add missing gpio_free()
[~shefty/rdma-dev.git] / drivers / gpio / gpiolib.c
index 21da9c19a0cba82e1a8aba6aa52056953efb4f82..649550e2cae99947027df5f2887e77016f554b54 100644 (file)
@@ -1281,6 +1281,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
                err = gpio_direction_output(gpio,
                                (flags & GPIOF_INIT_HIGH) ? 1 : 0);
 
+       if (err)
+               gpio_free(gpio);
+
        return err;
 }
 EXPORT_SYMBOL_GPL(gpio_request_one);