mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
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:
parent
13f2483cd5
commit
81a08382ae
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user