net/pcap: fix resource leakage on port probe
authorQiming Chen <chenqiming_huawei@163.com>
Mon, 30 Aug 2021 03:01:08 +0000 (11:01 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 9 Sep 2021 13:01:47 +0000 (15:01 +0200)
commitda0280b3a34c6f67f7e558fcc86c3110816fea28
treeb1f45554f9b42dad8edc436322df1b3c4c0e481e
parent30b4d95a29b1bf7e868d799952aa1fa1348d5e25
net/pcap: fix resource leakage on port probe

When the port is probed, if the eth_from_pcaps function fails, the
previously opened pcap resources are not released, causing resource
leakage.

The patch solves the problem of resource leakage caused by abnormal
branch exit during the port probe process.

Fixes: 4c173302c307 ("pcap: add new driver")
Cc: stable@dpdk.org
Signed-off-by: Qiming Chen <chenqiming_huawei@163.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/pcap/pcap_ethdev.c