From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id DF305A0C4B
	for <public@inbox.dpdk.org>; Sat, 13 Nov 2021 09:38:52 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id D6FF340698;
	Sat, 13 Nov 2021 09:38:52 +0100 (CET)
Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])
 by mails.dpdk.org (Postfix) with ESMTP id 6701040E25
 for <stable@dpdk.org>; Sat, 13 Nov 2021 09:38:50 +0100 (CET)
Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.54])
 by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4HrphX4HzBz1DJNt;
 Sat, 13 Nov 2021 16:36:28 +0800 (CST)
Received: from kwepemm600004.china.huawei.com (7.193.23.242) by
 dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2308.15; Sat, 13 Nov 2021 16:38:46 +0800
Received: from localhost.localdomain (10.67.165.24) by
 kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.2308.15; Sat, 13 Nov 2021 16:38:45 +0800
From: Huisong Li <lihuisong@huawei.com>
To: <stable@dpdk.org>, <xuemingl@nvidia.com>
CC: <lihuisong@huawei.com>, <fengchengwen@huawei.com>
Subject: [PATCH V1 2/2] net/hns3: fix interrupt vector freeing
Date: Sat, 13 Nov 2021 16:34:12 +0800
Message-ID: <20211113083412.20894-3-lihuisong@huawei.com>
X-Mailer: git-send-email 2.33.0
In-Reply-To: <20211113083412.20894-1-lihuisong@huawei.com>
References: <20211113083412.20894-1-lihuisong@huawei.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Originating-IP: [10.67.165.24]
X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To
 kwepemm600004.china.huawei.com (7.193.23.242)
X-CFilter-Loop: Reflected
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org

From: Chengwen Feng <fengchengwen@huawei.com>

[ upstream commit f93819cf5abc047905c464fe4abf84fa823239dd ]

The intr_handle->intr_vec is allocated by rte_zmalloc(), but freed by
free(), this patch fixes it.

Fixes: 02a7b55657b2 ("net/hns3: support Rx interrupt")

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 drivers/net/hns3/hns3_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c
index 086828180b..b4a1ec0c7c 100644
--- a/drivers/net/hns3/hns3_ethdev_vf.c
+++ b/drivers/net/hns3/hns3_ethdev_vf.c
@@ -2159,7 +2159,7 @@ hns3vf_map_rx_interrupt(struct rte_eth_dev *dev)
 vf_bind_vector_error:
 	rte_intr_efd_disable(intr_handle);
 	if (intr_handle->intr_vec) {
-		free(intr_handle->intr_vec);
+		rte_free(intr_handle->intr_vec);
 		intr_handle->intr_vec = NULL;
 	}
 	return ret;
-- 
2.33.0