Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: hyperv: Set the hid drvdata correctly

Set the hid drvdata prior to invoking hid_add_device() as hid_add_device()
expects this state to be set. This bug was introduced in the recent hid
changes that were made in 07d9ab4f0e52cb ("HID: hid-hyperv: Do not use
hid_parse_report() directly").

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

K. Y. Srinivasan and committed by
Jiri Kosina
b565a390 16b79bb8

+2 -1
+2 -1
drivers/hid/hid-hyperv.c
··· 516 516 517 517 sprintf(hid_dev->name, "%s", "Microsoft Vmbus HID-compliant Mouse"); 518 518 519 + hid_set_drvdata(hid_dev, device); 520 + 519 521 ret = hid_add_device(hid_dev); 520 522 if (ret) 521 523 goto probe_err1; 522 524 523 - hid_set_drvdata(hid_dev, device); 524 525 525 526 ret = hid_parse(hid_dev); 526 527 if (ret) {