From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB766A0525; Mon, 20 Jan 2020 09:31:00 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 66D3C2C6D; Mon, 20 Jan 2020 09:30:59 +0100 (CET) Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by dpdk.org (Postfix) with ESMTP id 2FA172BF5; Mon, 20 Jan 2020 09:30:57 +0100 (CET) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 9E59154DD58D42A49ACD; Mon, 20 Jan 2020 16:30:55 +0800 (CST) Received: from localhost (10.133.209.164) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.439.0; Mon, 20 Jan 2020 16:30:47 +0800 From: Yunjian Wang To: , CC: , Yunjian Wang , Date: Mon, 20 Jan 2020 16:30:45 +0800 Message-ID: <1579509045-18296-1-git-send-email-wangyunjian@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.133.209.164] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH] net/tap: fix memory leak when unregister intr handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/net/tap/rte_eth_tap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index a13d8d50d..079310fea 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -1591,8 +1591,10 @@ 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) { + 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); -- 2.19.1