]> Pileus Git - ~andy/linux/commitdiff
drivers/pinctrl/pinctrl-nomadik.c: drop devm_kfree of devm_kzalloc'd data
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 4 Aug 2012 16:50:47 +0000 (18:50 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Tue, 7 Aug 2012 12:34:12 +0000 (14:34 +0200)
devm_kfree should not have to be explicitly used.

The semantic patch that fixes this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,d;
@@

x = devm_kzalloc(...)
...
?-devm_kfree(d,x);
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-nomadik.c

index 53b0d49a7a1c817a7316fc25e57fff3a5c5341bb..ec6ac501b23a077559f303adc7fb1e07bf68698c 100644 (file)
@@ -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;