Skip to content

Commit

Permalink
isp1704_charger: Use after free on probe error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and Anton Vorontsov committed May 6, 2012
1 parent 13f2483 commit 81a0838
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/isp1704_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 81a0838

Please sign in to comment.