net/virtio: fix queue memory leak on error
authorTiwei Bie <tiwei.bie@intel.com>
Wed, 5 Jun 2019 09:43:38 +0000 (17:43 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 20 Jun 2019 21:42:04 +0000 (23:42 +0200)
We should free queues when we failed to initialize the virtio device.

Fixes: 26b683b4f7d0 ("net/virtio: setup Rx queue interrupts")
Cc: stable@dpdk.org
Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
drivers/net/virtio/virtio_ethdev.c

index c4570bb..df3a218 100644 (file)
@@ -1752,6 +1752,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
        if (eth_dev->data->dev_conf.intr_conf.rxq) {
                if (virtio_configure_intr(eth_dev) < 0) {
                        PMD_INIT_LOG(ERR, "failed to configure interrupt");
+                       virtio_free_queues(hw);
                        return -1;
                }
        }