diff mbox series

[v2,43/83] net/bonding: remove unnecessary NULL checks

Message ID 20220124174719.14417-44-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 5:46 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Min Hu (Connor) Jan. 25, 2022, 12:49 a.m. UTC | #1
Acked-by: Min Hu (Connor) <humin29@huawei.com>

在 2022/1/25 1:46, Stephen Hemminger 写道:
> Remove redundant NULL pointer checks before free functions
> found by nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
>   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;
>   }
>
diff mbox series

Patch

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;
 }