[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120327202212.GB9197@elgon.mountain>
Date: Tue, 27 Mar 2012 23:22:13 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Anton Vorontsov <anton.vorontsov@...aro.org>,
Felipe Contreras <felipe.contreras@...il.com>
Cc: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Felipe Balbi <balbi@...com>,
Marek Vasut <marek.vasut@...il.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] isp1704_charger: use after free on probe error
We can't use "isp" after freeing it.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists