diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-03-27 16:22:13 -0400 |
---|---|---|
committer | Anton Vorontsov <anton.vorontsov@linaro.org> | 2012-05-05 23:02:35 -0400 |
commit | 81a08382aeb802ad642ab7f2a7786baa7bafaaa3 (patch) | |
tree | 50e619b0f36c3a0f41e8d2019adc8d7099161a5d /drivers/power/isp1704_charger.c | |
parent | 13f2483cd5e3df425cfa492cc62cf8fada5d01b9 (diff) |
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/isp1704_charger.c')
-rw-r--r-- | drivers/power/isp1704_charger.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
474 | fail2: | 474 | fail2: |
475 | power_supply_unregister(&isp->psy); | 475 | power_supply_unregister(&isp->psy); |
476 | fail1: | 476 | fail1: |
477 | isp1704_charger_set_power(isp, 0); | ||
477 | usb_put_transceiver(isp->phy); | 478 | usb_put_transceiver(isp->phy); |
478 | fail0: | 479 | fail0: |
479 | kfree(isp); | 480 | kfree(isp); |
480 | 481 | ||
481 | dev_err(&pdev->dev, "failed to register isp1704 with error %d\n", ret); | 482 | dev_err(&pdev->dev, "failed to register isp1704 with error %d\n", ret); |
482 | 483 | ||
483 | isp1704_charger_set_power(isp, 0); | ||
484 | return ret; | 484 | return ret; |
485 | } | 485 | } |
486 | 486 | ||