Skip to content

Commit b5bcb94

Browse files
Yang YingliangJiri Kosina
authored andcommitted
HID: hyperv: fix possible memory leak in mousevsc_probe()
If hid_add_device() returns error, it should call hid_destroy_device() to free hid_dev which is allocated in hid_allocate_device(). Fixes: 74c4fb0 ("HID: hv_mouse: Properly add the hid device") Signed-off-by: Yang Yingliang <[email protected]> Reviewed-by: Wei Liu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 7f9dbf5 commit b5bcb94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-hyperv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ static int mousevsc_probe(struct hv_device *device,
499499

500500
ret = hid_add_device(hid_dev);
501501
if (ret)
502-
goto probe_err1;
502+
goto probe_err2;
503503

504504

505505
ret = hid_parse(hid_dev);

0 commit comments

Comments
 (0)