From: Huawei Xie Date: Fri, 30 Jan 2015 07:13:36 +0000 (+0800) Subject: examples/vhost: fix crash when linking device to VMDQ fails X-Git-Tag: spdx-start~9804 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=51ec3ae2afaca9b2a76b43bde272edeac8174147;p=dpdk.git examples/vhost: fix crash when linking device to VMDQ fails Signed-off-by: Huawei Xie Acked-by: Changchun Ouyang --- diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 04f01182d0..3a35359b87 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -1308,8 +1308,8 @@ switch_worker(__attribute__((unused)) void *arg) /* If this is the first received packet we need to learn the MAC and setup VMDQ */ if (unlikely(vdev->ready == DEVICE_MAC_LEARNING) && tx_count) { if (vdev->remove || (link_vmdq(vdev, pkts_burst[0]) == -1)) { - while (tx_count--) - rte_pktmbuf_free(pkts_burst[tx_count]); + while (tx_count) + rte_pktmbuf_free(pkts_burst[--tx_count]); } } while (tx_count)