diff options
| -rw-r--r-- | drivers/hid/hid-logitech-hidpp.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c index 41b39464ded8..501e16a9227d 100644 --- a/drivers/hid/hid-logitech-hidpp.c +++ b/drivers/hid/hid-logitech-hidpp.c | |||
| @@ -2732,6 +2732,9 @@ static int hidpp_initialize_battery(struct hidpp_device *hidpp) | |||
| 2732 | hidpp_battery_props, | 2732 | hidpp_battery_props, |
| 2733 | sizeof(hidpp_battery_props), | 2733 | sizeof(hidpp_battery_props), |
| 2734 | GFP_KERNEL); | 2734 | GFP_KERNEL); |
| 2735 | if (!battery_props) | ||
| 2736 | return -ENOMEM; | ||
| 2737 | |||
| 2735 | num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2; | 2738 | num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2; |
| 2736 | 2739 | ||
| 2737 | if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE) | 2740 | if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE) |
