Skip to content

Commit 06a57f4

Browse files
committed
Merge git://git.infradead.org/users/cbou/battery-2.6.33
* git://git.infradead.org/users/cbou/battery-2.6.33: wm97xx_battery: Handle missing platform data gracefully
2 parents fd48d6c + 12b336a commit 06a57f4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/power/wm97xx_battery.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,14 @@ static int __devinit wm97xx_bat_probe(struct platform_device *dev)
175175
dev_err(&dev->dev, "Do not pass platform_data through "
176176
"wm97xx_bat_set_pdata!\n");
177177
return -EINVAL;
178-
} else
179-
pdata = wmdata->batt_pdata;
178+
}
179+
180+
if (!wmdata) {
181+
dev_err(&dev->dev, "No platform data supplied\n");
182+
return -EINVAL;
183+
}
184+
185+
pdata = wmdata->batt_pdata;
180186

181187
if (dev->id != -1)
182188
return -EINVAL;

0 commit comments

Comments
 (0)