examples/vhost: fix segfault when link_vmdq fails
PATCH 1/1 examples/vhost: fix segfault when link_vmdq fails
Signed-off-by Huawei Xie <[email protected]>
--- examples/vhost/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
examples/vhost/main.c +2 -2
@@ -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)
Signature · 1 line
1.8.1.4
Ouyang, Changchun
Acked-byQuoted 9 lines
-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Huawei Xie
Sent: Friday, January 30, 2015 3:14 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH] examples/vhost: fix segfault whenlink_vmdqfailsSigned-off-by Huawei Xie <[email protected]>
Acked-by Changchun Ouyang <[email protected]>
Quoted 26 lines
--- examples/vhost/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)examples/vhost/main.c index renamed from examples/vhost/main.c +0
-004f0118..3a35359 100644
examples/vhost/main.c +0
-0@@ -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)) {examples/vhost/main.c +0
-2-while (tx_count--) -rte_pktmbuf_free(pkts_burst[tx_count]);examples/vhost/main.c +2
-0+while (tx_count) +rte_pktmbuf_free(pkts_burst[--tx_count]);examples/vhost/main.c +0
-1} }while (tx_count) --1.8.1.4
Thomas Monjalon
AppliedQuoted 3 lines
Quoted 1 line
Signed-off-by Huawei Xie <[email protected]>Acked-by Changchun Ouyang <[email protected]>
Applied
Thanks
Signature · 1 line
Thomas