diff options
-rw-r--r-- | drivers/power/gpio-charger.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c index fccbe99..8458caf 100644 --- a/drivers/power/gpio-charger.c +++ b/drivers/power/gpio-charger.c @@ -87,6 +87,10 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev) } gpio_charger = kzalloc(sizeof(*gpio_charger), GFP_KERNEL); + if (!gpio_charger) { + dev_err(&pdev->dev, "Failed to alloc driver structure\n"); + return -ENOMEM; + } charger = &gpio_charger->charger; |