Commit 817b8b9c authored by Dongliang Mu's avatar Dongliang Mu Committed by Jiri Kosina
Browse files

HID: elo: fix memory leak in elo_probe



When hid_parse() in elo_probe() fails, it forgets to call usb_put_dev to
decrease the refcount.

Fix this by adding usb_put_dev() in the error handling code of elo_probe().

Fixes: fbf42729 ("HID: elo: update the reference count of the usb device structure")
Reported-by: default avatarsyzkaller <syzkaller@googlegroups.com>
Signed-off-by: default avatarDongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent e26a7805
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ static int elo_probe(struct hid_device *hdev, const struct hid_device_id *id)

	return 0;
err_free:
	usb_put_dev(udev);
	kfree(priv);
	return ret;
}