Drivers: hv: vmbus: fix double free in the error path of vmbus_add_channel_work()
stable inclusion from stable-v5.10.157 commit 909186cf34de7d761833d064cd58c64cf6884e00 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=909186cf34de7d761833d064cd58c64cf6884e00 -------------------------------- [ Upstream commit f92a4b50 ] In the error path of vmbus_device_register(), device_unregister() is called, which calls vmbus_device_release(). The latter frees the struct hv_device that was passed in to vmbus_device_register(). So remove the kfree() in vmbus_add_channel_work() to avoid a double free. Fixes: c2e5df61 ("vmbus: add per-channel sysfs info") Suggested-by:Michael Kelley <mikelley@microsoft.com> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com> Reviewed-by:
Michael Kelley <mikelley@microsoft.com> Link: https://lore.kernel.org/r/20221119081135.1564691-2-yangyingliang@huawei.com Signed-off-by:
Wei Liu <wei.liu@kernel.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment