From: Julia Lawall Date: Sat, 4 Aug 2012 16:50:47 +0000 (+0200) Subject: drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc'd data X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=75c353ecacf54dbcca5e2e4388088893aac0fc34;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc'd data devm_kfree should not have to be explicitly used. The semantic patch that fixes this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression x,d; @@ x = devm_kzalloc(...) ... ?-devm_kfree(d,x); // Signed-off-by: Julia Lawall Signed-off-by: Linus Walleij --- diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c index 53b0d49a7a1c..ec6ac501b23a 100644 --- a/drivers/pinctrl/pinctrl-nomadik.c +++ b/drivers/pinctrl/pinctrl-nomadik.c @@ -1731,7 +1731,6 @@ static int __devinit nmk_pinctrl_probe(struct platform_device *pdev) for (i = 0; i < npct->soc->gpio_num_ranges; i++) { if (!nmk_gpio_chips[i]) { dev_warn(&pdev->dev, "GPIO chip %d not registered yet\n", i); - devm_kfree(&pdev->dev, npct); return -EPROBE_DEFER; } npct->soc->gpio_ranges[i].gc = &nmk_gpio_chips[i]->chip;