Skip to content

Commit

Permalink
HID: hyperv: Set the hid drvdata correctly
Browse files Browse the repository at this point in the history
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 07d9ab4 ("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>
  • Loading branch information
K. Y. Srinivasan authored and Jiri Kosina committed May 17, 2012
1 parent 16b79bb commit b565a39
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-hyperv.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,12 @@ static int mousevsc_probe(struct hv_device *device,

sprintf(hid_dev->name, "%s", "Microsoft Vmbus HID-compliant Mouse");

hid_set_drvdata(hid_dev, device);

ret = hid_add_device(hid_dev);
if (ret)
goto probe_err1;

hid_set_drvdata(hid_dev, device);

ret = hid_parse(hid_dev);
if (ret) {
Expand Down

0 comments on commit b565a39

Please sign in to comment.