rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl
authorArnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Tue, 26 Apr 2022 06:05:36 +0000 (14:05 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:05 +0000 (18:36 +0200)
commit4ff1449e8fd9e38d31d326c13d156c3f456ba72c
tree77b1d1fcf4e5d773bda4967005106c5eae7a20f9
parentb94d40c792de7f0ceda6a2fd8a8dc0597eca6d22
rpmsg: virtio: Fix the unregistration of the device rpmsg_ctrl

[ Upstream commit df191796985922488e4e6b64f7bd79c3934412f2 ]

Unregister the rpmsg_ctrl device instead of just freeing the
the virtio_rpmsg_channel structure.
This will properly unregister the device and call
virtio_rpmsg_release_device() that frees the structure.

Fixes: c486682ae1e2 ("rpmsg: virtio: Register the rpmsg_char device")
Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
Reviewed-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20220426060536.15594-4-hbh25y@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/rpmsg/virtio_rpmsg_bus.c