From 81a08382aeb802ad642ab7f2a7786baa7bafaaa3 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 27 Mar 2012 23:22:13 +0300 Subject: isp1704_charger: Use after free on probe error We can't use "isp" after freeing it. Signed-off-by: Dan Carpenter Reviewed-by: Felipe Contreras Signed-off-by: Anton Vorontsov --- drivers/power/isp1704_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c index 39eb50f35f09..e5ccd2979773 100644 --- a/drivers/power/isp1704_charger.c +++ b/drivers/power/isp1704_charger.c @@ -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; } -- cgit v1.2.3-58-ga151