Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1233296 > unrolled thread

[PATCH] gpio: max730x: eliminate double free

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2015-09-26 22:30 +0200
Last post2015-10-02 23:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] gpio: max730x: eliminate double free Julia Lawall <Julia.Lawall@lip6.fr> - 2015-09-26 22:30 +0200
    Re: [PATCH] gpio: max730x: eliminate double free Alexandre Courbot <gnurou@gmail.com> - 2015-09-28 03:50 +0200
    Re: [PATCH] gpio: max730x: eliminate double free Linus Walleij <linus.walleij@linaro.org> - 2015-10-02 23:50 +0200

#1233296 — [PATCH] gpio: max730x: eliminate double free

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2015-09-26 22:30 +0200
Subject[PATCH] gpio: max730x: eliminate double free
Message-ID<qd4gy-28W-5@gated-at.bofh.it>
The function __max730x_remove is called from the remove functions of
drivers/gpio/gpio-max7300.c and drivers/gpio/gpio-max7301.c.  In both
cases, the probe function allocates ts using devm_kzalloc.  Explicitly
freeing such a value with kfree will cause a double free.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/gpio/gpio-max730x.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c
index 18ab89e..0f57d2d 100644
--- a/drivers/gpio/gpio-max730x.c
+++ b/drivers/gpio/gpio-max730x.c
@@ -236,7 +236,6 @@ int __max730x_remove(struct device *dev)
 	ts->write(dev, 0x04, 0x00);
 	gpiochip_remove(&ts->chip);
 	mutex_destroy(&ts->lock);
-	kfree(ts);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(__max730x_remove);

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1233811

FromAlexandre Courbot <gnurou@gmail.com>
Date2015-09-28 03:50 +0200
Message-ID<qdvJL-7Zw-1@gated-at.bofh.it>
In reply to#1233296
On Sun, Sep 27, 2015 at 5:18 AM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:
> The function __max730x_remove is called from the remove functions of
> drivers/gpio/gpio-max7300.c and drivers/gpio/gpio-max7301.c.  In both
> cases, the probe function allocates ts using devm_kzalloc.  Explicitly
> freeing such a value with kfree will cause a double free.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1238634

FromLinus Walleij <linus.walleij@linaro.org>
Date2015-10-02 23:50 +0200
Message-ID<qfgnh-7jB-19@gated-at.bofh.it>
In reply to#1233296
On Sat, Sep 26, 2015 at 1:18 PM, Julia Lawall <Julia.Lawall@lip6.fr> wrote:

> The function __max730x_remove is called from the remove functions of
> drivers/gpio/gpio-max7300.c and drivers/gpio/gpio-max7301.c.  In both
> cases, the probe function allocates ts using devm_kzalloc.  Explicitly
> freeing such a value with kfree will cause a double free.
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Patch applied with Alex' review-tag.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web