Skip to content

Commit

Permalink
net/virtio: fix queue memory leak on error
Browse files Browse the repository at this point in the history
[ upstream commit 2b38151 ]

We should free queues when we failed to initialize the virtio device.

Fixes: 26b683b ("net/virtio: setup Rx queue interrupts")

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
  • Loading branch information
Tiwei Bie authored and kevintraynor committed Jun 24, 2019
1 parent 131c802 commit 5f34f2e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/virtio/virtio_ethdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,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;
}
}
Expand Down

0 comments on commit 5f34f2e

Please sign in to comment.