summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-03-27 23:22:13 +0300
committerAnton Vorontsov <anton.vorontsov@linaro.org>2012-05-05 20:02:35 -0700
commit81a08382aeb802ad642ab7f2a7786baa7bafaaa3 (patch)
tree50e619b0f36c3a0f41e8d2019adc8d7099161a5d /drivers/power
parent13f2483cd5e3df425cfa492cc62cf8fada5d01b9 (diff)
downloadop-kernel-dev-81a08382aeb802ad642ab7f2a7786baa7bafaaa3.zip
op-kernel-dev-81a08382aeb802ad642ab7f2a7786baa7bafaaa3.tar.gz
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>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/isp1704_charger.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index 39eb50f..e5ccd29 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;
}
OpenPOWER on IntegriCloud