diff options
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 6d1b86661e6..eb0c3fe44b2 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/seq_file.h> | 9 | #include <linux/seq_file.h> |
10 | #include <linux/gpio.h> | 10 | #include <linux/gpio.h> |
11 | #include <linux/idr.h> | 11 | #include <linux/idr.h> |
12 | #include <linux/slab.h> | ||
12 | 13 | ||
13 | 14 | ||
14 | /* Optional implementation infrastructure for GPIO interfaces. | 15 | /* Optional implementation infrastructure for GPIO interfaces. |
@@ -415,7 +416,8 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev, | |||
415 | return 0; | 416 | return 0; |
416 | 417 | ||
417 | free_sd: | 418 | free_sd: |
418 | sysfs_put(pdesc->value_sd); | 419 | if (pdesc) |
420 | sysfs_put(pdesc->value_sd); | ||
419 | free_id: | 421 | free_id: |
420 | idr_remove(&pdesc_idr, id); | 422 | idr_remove(&pdesc_idr, id); |
421 | desc->flags &= GPIO_FLAGS_MASK; | 423 | desc->flags &= GPIO_FLAGS_MASK; |