summaryrefslogtreecommitdiff
path: root/drivers/power/supply/isp1704_charger.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/supply/isp1704_charger.c')
-rw-r--r--drivers/power/supply/isp1704_charger.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/supply/isp1704_charger.c b/drivers/power/supply/isp1704_charger.c
index 4cd6899b961e..95af5f305838 100644
--- a/drivers/power/supply/isp1704_charger.c
+++ b/drivers/power/supply/isp1704_charger.c
@@ -418,6 +418,10 @@ static int isp1704_charger_probe(struct platform_device *pdev)
pdata = devm_kzalloc(&pdev->dev,
sizeof(struct isp1704_charger_data), GFP_KERNEL);
+ if (!pdata) {
+ ret = -ENOMEM;
+ goto fail0;
+ }
pdata->enable_gpio = gpio;
dev_info(&pdev->dev, "init gpio %d\n", pdata->enable_gpio);