On Tue, Feb 18, 2020 at 06:22:39PM +0100, Maxime Coquelin wrote:
> If for some reason vhost_driver_setup() fails, the list
> element for the device may be freed without being removed
> from the internal list of devices.
>
> This patch fixes all the error paths, by unregistering the
> device from Vhost library it has been registered, remove
> the device from the list, reset device vring_state pointer
> from the global table and only free vring state if it had
> been allocated.
>
> Fixes: 3d01b759d267 ("net/vhost: delay driver setup")
>
> Signed-off-by: Maxime Coquelin <[email protected]>
> Reviewed-by: David Marchand <[email protected]>
> ---
> drivers/net/vhost/rte_eth_vhost.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
Reviewed-by: Tiwei Bie <[email protected]>
Thanks,
Tiwei