net/af_packet: fix munmap on init failure
authorYunjian Wang <wangyunjian@huawei.com>
Mon, 6 Jul 2020 12:28:02 +0000 (20:28 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jul 2020 16:21:21 +0000 (18:21 +0200)
commitb02e1742ebb5a6c23bea05c4d66b1d380bcd00eb
treeb80f2935c89bc3b7f2ee2d0bf8dd2dc51e60a35e
parent3400148949ea4edecba0256f4ab97e80f1d98474
net/af_packet: fix munmap on init failure

Add a missing available check and fix the wrong address passed
to munmap on init failure.

Fixes: dd6590fe2fd7 ("af_packet: fix possible memory leak")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/af_packet/rte_eth_af_packet.c