Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7474f23d authored by Julia Lawall's avatar Julia Lawall Committed by Linus Walleij
Browse files

gpio: max730x: eliminate double free



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: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 450fa54c
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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);