diff options
author | Libo Chen <clbchenlibo.chen@huawei.com> | 2013-07-09 08:34:28 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2013-07-10 15:42:51 -0400 |
commit | fef8ce166b2d5cdba8bbf85fa48c4cb8d75ffec4 (patch) | |
tree | 50eb445157b91520524ad9f7ef9c6b890c185332 /drivers/platform | |
parent | 283672e425b24fe4046535973460e8732f4bd485 (diff) |
x86 platform drivers: fix gpio leak
when request_irq fails, we should release gpiochip
v2:
fix warning: ignoring return value of 'gpiochip_remove
Signed-off-by: Libo Chen <libo.chen@huawei.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_pmic_gpio.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel_pmic_gpio.c b/drivers/platform/x86/intel_pmic_gpio.c index 6f4b7289a059..2805988485f6 100644 --- a/drivers/platform/x86/intel_pmic_gpio.c +++ b/drivers/platform/x86/intel_pmic_gpio.c | |||
@@ -288,7 +288,7 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) | |||
288 | retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg); | 288 | retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg); |
289 | if (retval) { | 289 | if (retval) { |
290 | pr_warn("Interrupt request failed\n"); | 290 | pr_warn("Interrupt request failed\n"); |
291 | goto err; | 291 | goto fail_request_irq; |
292 | } | 292 | } |
293 | 293 | ||
294 | for (i = 0; i < 8; i++) { | 294 | for (i = 0; i < 8; i++) { |
@@ -299,6 +299,10 @@ static int platform_pmic_gpio_probe(struct platform_device *pdev) | |||
299 | irq_set_chip_data(i + pg->irq_base, pg); | 299 | irq_set_chip_data(i + pg->irq_base, pg); |
300 | } | 300 | } |
301 | return 0; | 301 | return 0; |
302 | |||
303 | fail_request_irq: | ||
304 | if (gpiochip_remove(&pg->chip)) | ||
305 | pr_err("gpiochip_remove failed\n"); | ||
302 | err: | 306 | err: |
303 | iounmap(pg->gpiointr); | 307 | iounmap(pg->gpiointr); |
304 | err2: | 308 | err2: |