Commit 9daf2746 authored by Yang Yingliang's avatar Yang Yingliang Committed by sanglipeng
Browse files

HID: hyperv: fix possible memory leak in mousevsc_probe()

stable inclusion
from stable-v5.10.155
commit 8597b59e3d22b27849bd3e4f92a3d466774bfb04
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7M5F4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=8597b59e3d22b27849bd3e4f92a3d466774bfb04



--------------------------------

[ Upstream commit b5bcb94b ]

If hid_add_device() returns error, it should call hid_destroy_device()
to free hid_dev which is allocated in hid_allocate_device().

Fixes: 74c4fb05 ("HID: hv_mouse: Properly add the hid device")
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarWei Liu <wei.liu@kernel.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 934c11d4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment