net/virtio: improve queue init error path
authorMaxime Coquelin <maxime.coquelin@redhat.com>
Tue, 16 Mar 2021 09:38:23 +0000 (10:38 +0100)
committerChenbo Xia <chenbo.xia@intel.com>
Wed, 31 Mar 2021 05:31:30 +0000 (07:31 +0200)
commit76fd789cc7dddbaa2c08065b7c3ca915b5c07e7c
tree2553af01e1b6652e570c160e8373170ad7375c0f
parent3169550f03c121616cf8995521b956701b837175
net/virtio: improve queue init error path

This patch improves the error path of virtio_init_queue(),
by cleaning in reversing order all resources that have
been allocated.

Suggested-by: Chenbo Xia <chenbo.xia@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Reviewed-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>
Tested-by: Balazs Nemeth <bnemeth@redhat.com>
drivers/net/virtio/virtio_ethdev.c