net/virtio-user: fix resource leak on probing failure
authorHarold Huang <baymaxhuang@gmail.com>
Thu, 23 Dec 2021 04:42:37 +0000 (12:42 +0800)
committerChenbo Xia <chenbo.xia@intel.com>
Thu, 27 Jan 2022 05:02:57 +0000 (06:02 +0100)
commitedca47a1d9e01cb6f9bd174cc1cbefce1af7fd37
treed94848d458d2d7a1d9a8404c1812a389534be447
parent527ec438eb31d4d821624f74d7dfd3b0bcc1c28e
net/virtio-user: fix resource leak on probing failure

When eth_virtio_dev_init is failed, the registered virtio user memory
event cb is not released and the backend created tap device is not
destroyed.  It would cause some residual tap device existed in the host
and creating a new vdev could be failed because the new virtio_user_dev
could use the same address pointer and register memory event cb to the
same address is not allowed.

Fixes: ca8326a94365 ("net/virtio_user: fix error management during init")
Cc: stable@dpdk.org
Signed-off-by: Harold Huang <baymaxhuang@gmail.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
drivers/net/virtio/virtio_user_ethdev.c