Skip to contentSkip to conversation

pinctrl: double free on error path in pinctrl_register()

PATCH In review Dan Carpenter 2 participants 2 messages Oct 2, 2011 – Oct 3, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: double free on error path in pinctrl_register()

This is duplicated in the error handling after we go to out_err.

drivers/pinctrl/core.c +0 -2
index f9263b2..8416a59 100644
@@ -559,8 +559,6 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
 	ret = device_register(&pctldev->dev);
 	if (ret != 0) {
 		pr_err("error in device registration\n");
-		put_device(&pctldev->dev);
-		kfree(pctldev);
 		goto out_err;
 	}
 	dev_set_drvdata(&pctldev->dev, pctldev);
#1 lore raw
Quoted 3 lines · Dan Carpenter

This is duplicated in the error handling after we go to out_err.

This got fixed by Axel Lin's patch that arrived just a little bit before this one,
but thanks anyway!

Yours,
Linus Walleij