net/tap: fix device freeing
authorYunjian Wang <wangyunjian@huawei.com>
Tue, 7 Jun 2022 06:50:57 +0000 (14:50 +0800)
committerAndrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Wed, 8 Jun 2022 12:39:13 +0000 (14:39 +0200)
commitf2aebfc4e941b315cebb71d6408dd5bbb0570a96
tree83bc48f44de86562f35da4cee8beae2afa9dc0c4
parentfd819cad0a266421ca9872570e923c2a7ae68183
net/tap: fix device freeing

The error path was calling rte_eth_dev_release_port() function,
which frees eth_dev->data->dev_private, and then tries to free
pmd->intr_handle, which causes the use after free issue.

The free can be moved to before the release function is called.

Fixes: d61138d4f0e ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org
Signed-off-by: Xiangjun Meng <mengxiangjun4@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
drivers/net/tap/rte_eth_tap.c