net/tap: fix mbuf double free when writev fails
authorYunjian Wang <wangyunjian@huawei.com>
Thu, 16 Apr 2020 03:04:07 +0000 (11:04 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:08 +0000 (13:57 +0200)
commit24cb500c17c6914fce4c8df278b06966d70b897d
treefe31003151a23ffec4431f8ef8ad2f8ec090d8fc
parent889cf609e555ab6b8263cb96d06ae4c7ddfb9a24
net/tap: fix mbuf double free when writev fails

When the tap_write_mbufs() function return with break, mbuf was freed
without increasing num_packets, which could cause applications to free
the mbuf again. And the pmd_tx_burst() function should returns the
number of original packets it actually sent excluding tso mbufs.

Fixes: 9396ad334672 ("net/tap: fix reported number of Tx packets")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
drivers/net/tap/rte_eth_tap.c