[52/82] net/ice: remove unnecessary NULL checks

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 12:04 a.m. UTC
  Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ice/ice_fdir_filter.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 13a2ac42df87..3fce8e1e6253 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -421,10 +421,8 @@  ice_fdir_release_filter_list(struct ice_pf *pf)
 {
 	struct ice_fdir_info *fdir_info = &pf->fdir;
 
-	if (fdir_info->hash_map)
-		rte_free(fdir_info->hash_map);
-	if (fdir_info->hash_table)
-		rte_hash_free(fdir_info->hash_table);
+	rte_free(fdir_info->hash_map);
+	rte_hash_free(fdir_info->hash_table);
 
 	fdir_info->hash_map = NULL;
 	fdir_info->hash_table = NULL;