Skip to content

Commit ac309e7

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID fixes from Jiri Kosina: - string buffer formatting fixes in picolcd and sensor drivers, from Takashi Iwai - two new device IDs from Chen-Tsung Hsieh and Tony Fischetti * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: HID: add ALWAYS_POLL quirk to lenovo pixart mouse HID: google: add moonball USB id HID: hid-sensor-custom: Use scnprintf() for avoiding potential buffer overflow HID: hid-picolcd_fb: Use scnprintf() for avoiding potential buffer overflow
2 parents 3d135f5 + 819d578 commit ac309e7

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

drivers/hid/hid-google-hammer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,8 @@ static const struct hid_device_id hammer_devices[] = {
532532
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MAGNEMITE) },
533533
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
534534
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MASTERBALL) },
535+
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
536+
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_MOONBALL) },
535537
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
536538
USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) },
537539
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,

drivers/hid/hid-ids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@
478478
#define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030
479479
#define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c
480480
#define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d
481+
#define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044
481482

482483
#define USB_VENDOR_ID_GOTOP 0x08f2
483484
#define USB_DEVICE_ID_SUPER_Q2 0x007f
@@ -726,6 +727,7 @@
726727
#define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085
727728
#define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3
728729
#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5
730+
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d
729731

730732
#define USB_VENDOR_ID_LG 0x1fd2
731733
#define USB_DEVICE_ID_LG_MULTITOUCH 0x0064

drivers/hid/hid-picolcd_fb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ static ssize_t picolcd_fb_update_rate_show(struct device *dev,
458458
if (ret >= PAGE_SIZE)
459459
break;
460460
else if (i == fb_update_rate)
461-
ret += snprintf(buf+ret, PAGE_SIZE-ret, "[%u] ", i);
461+
ret += scnprintf(buf+ret, PAGE_SIZE-ret, "[%u] ", i);
462462
else
463-
ret += snprintf(buf+ret, PAGE_SIZE-ret, "%u ", i);
463+
ret += scnprintf(buf+ret, PAGE_SIZE-ret, "%u ", i);
464464
if (ret > 0)
465465
buf[min(ret, (size_t)PAGE_SIZE)-1] = '\n';
466466
return ret;

drivers/hid/hid-quirks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ static const struct hid_device_id hid_quirks[] = {
103103
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912), HID_QUIRK_MULTI_INPUT },
104104
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M406XE), HID_QUIRK_MULTI_INPUT },
105105
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_PIXART_USB_OPTICAL_MOUSE_ID2), HID_QUIRK_ALWAYS_POLL },
106+
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D), HID_QUIRK_ALWAYS_POLL },
106107
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C007), HID_QUIRK_ALWAYS_POLL },
107108
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_C077), HID_QUIRK_ALWAYS_POLL },
108109
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_KEYBOARD_G710_PLUS), HID_QUIRK_NOGET },

drivers/hid/hid-sensor-custom.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr,
313313

314314
while (i < ret) {
315315
if (i + attribute->size > ret) {
316-
len += snprintf(&buf[len],
316+
len += scnprintf(&buf[len],
317317
PAGE_SIZE - len,
318318
"%d ", values[i]);
319319
break;
@@ -336,10 +336,10 @@ static ssize_t show_value(struct device *dev, struct device_attribute *attr,
336336
++i;
337337
break;
338338
}
339-
len += snprintf(&buf[len], PAGE_SIZE - len,
339+
len += scnprintf(&buf[len], PAGE_SIZE - len,
340340
"%lld ", value);
341341
}
342-
len += snprintf(&buf[len], PAGE_SIZE - len, "\n");
342+
len += scnprintf(&buf[len], PAGE_SIZE - len, "\n");
343343

344344
return len;
345345
} else if (input)

0 commit comments

Comments
 (0)