提交 817b8b9c 编写于 作者: D Dongliang Mu 提交者: Jiri Kosina

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: Nsyzkaller <syzkaller@googlegroups.com>
Signed-off-by: NDongliang Mu <mudongliangabcd@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 e26a7805
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册