summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-logitech-hidpp.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@baylibre.com>2017-08-23 01:37:31 +0300
committerKevin Hilman <khilman@baylibre.com>2017-08-23 01:37:31 +0300
commit4db26f83a7a1f8b844e4543cd82a87bee1d224e2 (patch)
tree260f68e5671b902344f8b568a45bd6df645b5bcb /drivers/hid/hid-logitech-hidpp.c
parentb16c71c9f6ff50d4e4398cefd9113d82ee2fe8e6 (diff)
parentaae4e7a8bc44722fe70d58920a36916b1043195e (diff)
downloadlinux-4db26f83a7a1f8b844e4543cd82a87bee1d224e2.tar.xz
Merge tag 'v4.13-rc4' into v4.14/dt64
Linux 4.13-rc4
Diffstat (limited to 'drivers/hid/hid-logitech-hidpp.c')
-rw-r--r--drivers/hid/hid-logitech-hidpp.c3
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)
hidpp_battery_props,
sizeof(hidpp_battery_props),
GFP_KERNEL);
+ if (!battery_props)
+ return -ENOMEM;
+
num_battery_props = ARRAY_SIZE(hidpp_battery_props) - 2;
if (hidpp->capabilities & HIDPP_CAPABILITY_BATTERY_MILEAGE)