diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/power_supply_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 10f0b57f00d9..414384a4ab52 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) | |||
226 | of_node_put(np); | 226 | of_node_put(np); |
227 | } while (np); | 227 | } while (np); |
228 | 228 | ||
229 | /* Missing valid "power-supplies" entries */ | ||
230 | if (cnt == 1) | ||
231 | return 0; | ||
232 | |||
229 | /* All supplies found, allocate char ** array for filling */ | 233 | /* All supplies found, allocate char ** array for filling */ |
230 | psy->supplied_from = devm_kzalloc(psy->dev, sizeof(psy->supplied_from), | 234 | psy->supplied_from = devm_kzalloc(psy->dev, sizeof(psy->supplied_from), |
231 | GFP_KERNEL); | 235 | GFP_KERNEL); |