Skip to content

Commit

Permalink
gpio: max730x: eliminate double free
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Julia Lawall authored and Linus Walleij committed Oct 2, 2015
1 parent 450fa54 commit 7474f23
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/gpio/gpio-max730x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7474f23

Please sign in to comment.