From: Yunjian Wang Date: Tue, 21 Jan 2020 02:12:43 +0000 (+0800) Subject: net/tap: fix memory leak when unregister intr handler X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c5f9911d34650768355573bc53e0b621760c4124;p=dpdk.git net/tap: fix memory leak when unregister intr handler The return check of function tap_lsc_intr_handle_set() is wrong, it should be 0 or a positive number if success. So the intr_handle->intr_vec was not been freed when tap_lsc_intr_handle_set() returned a positive number. Fixes: 4870a8cdd968 ("net/tap: support Rx interrupt") Cc: stable@dpdk.org Signed-off-by: Yunjian Wang Acked-by: Ferruh Yigit --- diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index a13d8d50d7..05470a2115 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1591,8 +1591,11 @@ tap_intr_handle_set(struct rte_eth_dev *dev, int set) int err; err = tap_lsc_intr_handle_set(dev, set); - if (err) + if (err < 0) { + if (!set) + tap_rx_intr_vec_set(dev, 0); return err; + } err = tap_rx_intr_vec_set(dev, set); if (err && set) tap_lsc_intr_handle_set(dev, 0);