summaryrefslogtreecommitdiffstats
path: root/drivers/power/power_supply_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/power_supply_core.c')
-rw-r--r--drivers/power/power_supply_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c
index 10f0b57f00d..414384a4ab5 100644
--- a/drivers/power/power_supply_core.c
+++ b/drivers/power/power_supply_core.c
@@ -226,6 +226,10 @@ static int power_supply_check_supplies(struct power_supply *psy)
of_node_put(np);
} while (np);
+ /* Missing valid "power-supplies" entries */
+ if (cnt == 1)
+ return 0;
+
/* All supplies found, allocate char ** array for filling */
psy->supplied_from = devm_kzalloc(psy->dev, sizeof(psy->supplied_from),
GFP_KERNEL);