isp1704_charger: Use after free on probe error

We can't use "isp" after freeing it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
This commit is contained in:
Dan Carpenter 2012-03-27 23:22:13 +03:00 committed by Anton Vorontsov
parent 13f2483cd5
commit 81a08382ae

View file

@ -474,13 +474,13 @@ static int __devinit isp1704_charger_probe(struct platform_device *pdev)
fail2:
power_supply_unregister(&isp->psy);
fail1:
isp1704_charger_set_power(isp, 0);
usb_put_transceiver(isp->phy);
fail0:
kfree(isp);
dev_err(&pdev->dev, "failed to register isp1704 with error %d\n", ret);
isp1704_charger_set_power(isp, 0);
return ret;
}