um: virtio: free vu_dev only with the contained struct device
authorJohannes Berg <johannes.berg@intel.com>
Thu, 7 Jan 2021 21:15:21 +0000 (22:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Feb 2021 08:29:12 +0000 (09:29 +0100)
commit72c8389fc7ff0a931383f56a9a1148e629f42ade
tree329e17e25c02916328998e64854a6c23d7810f34
parent571fe1ba22c26ceedecec067ffe32235b8710b60
um: virtio: free vu_dev only with the contained struct device

[ Upstream commit f4172b084342fd3f9e38c10650ffe19eac30d8ce ]

Since struct device is refcounted, we shouldn't free the vu_dev
immediately when it's removed from the platform device, but only
when the references actually all go away. Move the freeing to
the release to accomplish that.

Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/um/drivers/virtio_uml.c