Commit 42d43c92 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull HID fixes from Jiri Kosina:

 - NULL pointer dereference fixes in amd_sfh driver (Basavaraj Natikar,
   Evgeny Novikov)

 - data processing fix for hid-u2fzero (Andrej Shadura)

 - fix for out-of-bounds write in hid-betop (F.A.Sulaiman)

 - new device IDs / device-specific quirks

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
  HID: amd_sfh: Fix potential NULL pointer dereference
  HID: u2fzero: ignore incomplete packets without data
  HID: amd_sfh: Fix potential NULL pointer dereference
  HID: wacom: Add new Intuos BT (CTL-4100WL/CTL-6100WL) device IDs
  HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS
  HID: betop: fix slab-out-of-bounds Write in betop_probe
parents 5816b3e6 88a04049
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -255,13 +255,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
	if (!privdata->cl_data)
		return -ENOMEM;

	rc = devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
	mp2_select_ops(privdata);

	rc = amd_sfh_hid_client_init(privdata);
	if (rc)
		return rc;

	mp2_select_ops(privdata);

	return amd_sfh_hid_client_init(privdata);
	return devm_add_action_or_reset(&pdev->dev, amd_mp2_pci_remove, privdata);
}

static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
+7 −0
Original line number Diff line number Diff line
@@ -336,12 +336,19 @@ static int apple_event(struct hid_device *hdev, struct hid_field *field,

/*
 * MacBook JIS keyboard has wrong logical maximum
 * Magic Keyboard JIS has wrong logical maximum
 */
static __u8 *apple_report_fixup(struct hid_device *hdev, __u8 *rdesc,
		unsigned int *rsize)
{
	struct apple_sc *asc = hid_get_drvdata(hdev);

	if(*rsize >=71 && rdesc[70] == 0x65 && rdesc[64] == 0x65) {
		hid_info(hdev,
			 "fixing up Magic Keyboard JIS report descriptor\n");
		rdesc[64] = rdesc[70] = 0xe7;
	}

	if ((asc->quirks & APPLE_RDESC_JIS) && *rsize >= 60 &&
			rdesc[53] == 0x65 && rdesc[59] == 0x65) {
		hid_info(hdev,
+10 −3
Original line number Diff line number Diff line
@@ -56,15 +56,22 @@ static int betopff_init(struct hid_device *hid)
{
	struct betopff_device *betopff;
	struct hid_report *report;
	struct hid_input *hidinput =
			list_first_entry(&hid->inputs, struct hid_input, list);
	struct hid_input *hidinput;
	struct list_head *report_list =
			&hid->report_enum[HID_OUTPUT_REPORT].report_list;
	struct input_dev *dev = hidinput->input;
	struct input_dev *dev;
	int field_count = 0;
	int error;
	int i, j;

	if (list_empty(&hid->inputs)) {
		hid_err(hid, "no inputs found\n");
		return -ENODEV;
	}

	hidinput = list_first_entry(&hid->inputs, struct hid_input, list);
	dev = hidinput->input;

	if (list_empty(report_list)) {
		hid_err(hid, "no output reports found\n");
		return -ENODEV;
+3 −1
Original line number Diff line number Diff line
@@ -198,7 +198,9 @@ static int u2fzero_rng_read(struct hwrng *rng, void *data,
	}

	ret = u2fzero_recv(dev, &req, &resp);
	if (ret < 0)

	/* ignore errors or packets without data */
	if (ret < offsetof(struct u2f_hid_msg, init.data))
		return 0;

	/* only take the minimum amount of data it is safe to take */
+8 −0
Original line number Diff line number Diff line
@@ -4746,6 +4746,12 @@ static const struct wacom_features wacom_features_0x393 =
	{ "Wacom Intuos Pro S", 31920, 19950, 8191, 63,
	  INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7,
	  .touch_max = 10 };
static const struct wacom_features wacom_features_0x3c6 =
	{ "Wacom Intuos BT S", 15200, 9500, 4095, 63,
	  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };
static const struct wacom_features wacom_features_0x3c8 =
	{ "Wacom Intuos BT M", 21600, 13500, 4095, 63,
	  INTUOSHT3_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 };

static const struct wacom_features wacom_features_HID_ANY_ID =
	{ "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
@@ -4919,6 +4925,8 @@ const struct hid_device_id wacom_ids[] = {
	{ USB_DEVICE_WACOM(0x37A) },
	{ USB_DEVICE_WACOM(0x37B) },
	{ BT_DEVICE_WACOM(0x393) },
	{ BT_DEVICE_WACOM(0x3c6) },
	{ BT_DEVICE_WACOM(0x3c8) },
	{ USB_DEVICE_WACOM(0x4001) },
	{ USB_DEVICE_WACOM(0x4004) },
	{ USB_DEVICE_WACOM(0x5000) },