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 63217A0352; Tue, 25 Jan 2022 01:49:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 50DBC41223; Tue, 25 Jan 2022 01:49:53 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id 21E7D41186 for ; Tue, 25 Jan 2022 01:49:52 +0100 (CET) Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4JjSsT72kkzcchN; Tue, 25 Jan 2022 08:49:01 +0800 (CST) Received: from [10.67.103.128] (10.67.103.128) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Tue, 25 Jan 2022 08:49:50 +0800 Subject: Re: [PATCH v2 43/83] net/bonding: remove unnecessary NULL checks To: Stephen Hemminger , CC: Chas Williams References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-1-stephen@networkplumber.org> <20220124174719.14417-44-stephen@networkplumber.org> From: "Min Hu (Connor)" Message-ID: Date: Tue, 25 Jan 2022 08:49:50 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20220124174719.14417-44-stephen@networkplumber.org> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.128] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected 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 Acked-by: Min Hu (Connor) ÔÚ 2022/1/25 1:46, Stephen Hemminger дµÀ: > Remove redundant NULL pointer checks before free functions > found by nullfree.cocci > > Signed-off-by: Stephen Hemminger > --- > drivers/net/bonding/rte_eth_bond_pmd.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c > index 84f4900ee52c..963280828a65 100644 > --- a/drivers/net/bonding/rte_eth_bond_pmd.c > +++ b/drivers/net/bonding/rte_eth_bond_pmd.c > @@ -2148,8 +2148,7 @@ bond_ethdev_close(struct rte_eth_dev *dev) > */ > rte_mempool_free(internals->mode6.mempool); > > - if (internals->kvlist != NULL) > - rte_kvargs_free(internals->kvlist); > + rte_kvargs_free(internals->kvlist); > > return 0; > } >