[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1384374039-18795-1-git-send-email-mpn@google.com>
Date: Wed, 13 Nov 2013 21:20:39 +0100
From: Michal Nazarewicz <mpn@...gle.com>
To: Linus Walleij <linus.walleij@...aro.org>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] gpio: fix memory leak in error path
From: Michal Nazarewicz <mina86@...a86.com>
Signed-off-by: Michal Nazarewicz <mina86@...a86.com>
---
drivers/gpio/gpiolib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 4e10b10..068011c 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1341,8 +1341,10 @@ int gpiochip_add_pingroup_range(struct gpio_chip *chip,
ret = pinctrl_get_group_pins(pctldev, pin_group,
&pin_range->range.pins,
&pin_range->range.npins);
- if (ret < 0)
+ if (ret < 0) {
+ kfree(pin_range);
return ret;
+ }
pinctrl_add_gpio_range(pctldev, &pin_range->range);
--
1.8.4.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists