Commit e975e471 authored by Johannes Berg's avatar Johannes Berg Committed by Zheng Zengkai
Browse files

um: virtio_uml: fix memory leak on init failures

stable inclusion
from stable-5.10.69
commit 9d49973b08488f59dd0ada269d9dca210d1fd365
bugzilla: 182675 https://gitee.com/openeuler/kernel/issues/I4I3ED

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



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

commit 7ad28e0d upstream.

If initialization fails, e.g. because the connection failed,
we leak the 'vu_dev'. Fix that. Reported by smatch.

Fixes: 5d38f324 ("um: drivers: Add virtio vhost-user driver")
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 7e26aafc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment