From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 804FDA0548; Tue, 27 Apr 2021 04:08:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F0B0840143; Tue, 27 Apr 2021 04:08:42 +0200 (CEST) Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by mails.dpdk.org (Postfix) with ESMTP id A53F94003E for ; Tue, 27 Apr 2021 04:08:41 +0200 (CEST) Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FTlVX3Sv3z17RV8 for ; Tue, 27 Apr 2021 10:06:12 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.498.0; Tue, 27 Apr 2021 10:08:34 +0800 From: "Min Hu (Connor)" To: CC: Date: Tue, 27 Apr 2021 10:08:45 +0800 Message-ID: <1619489325-31820-1-git-send-email-humin29@huawei.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1619063789-60922-3-git-send-email-humin29@huawei.com> References: <1619063789-60922-3-git-send-email-humin29@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Subject: [dpdk-dev] [PATCH v2] net/kni: fix rewritten return value X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Return value of function 'eth_kni_dev_stop' passed to 'ret' is rewritten later, and this is unreasonable. This patch fixes it. Fixes: 62024eb82756 ("ethdev: change stop operation callback to return int") Cc: stable@dpdk.org Signed-off-by: Min Hu (Connor) --- v2: * just log but not return. --- drivers/net/kni/rte_eth_kni.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 9ce74e5..00f9e1b 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -211,6 +211,9 @@ eth_kni_close(struct rte_eth_dev *eth_dev) return 0; ret = eth_kni_dev_stop(eth_dev); + if (ret) + PMD_LOG(WARNING, "Not able to stop kni for %s", + eth_dev->data->name); /* mac_addrs must not be freed alone because part of dev_private */ eth_dev->data->mac_addrs = NULL; -- 2.7.4