Skip to contentSkip to conversation

igb: fix itnull.cocci warnings

PATCH New Julia Lawall 2 participants 2 messages Dec 23, 2015 – Jan 7, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb: fix itnull.cocci warnings

The index variable of list_for_each_entry_safe should never be NULL.

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC Gangfeng Huang <[email protected]>

---

 igb_cdev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/igb_cdev.c +1 -2
@@ -411,8 +411,7 @@ static int igb_close_file(struct inode *
 
 		list_for_each_entry_safe(userpage, tmp,
 					 &adapter->user_page_list, page_node) {
-			if (userpage)
-				igb_free_page(adapter, userpage);
+			igb_free_page(adapter, userpage);
 		}
 	}
 	mutex_unlock(&adapter->user_page_mutex);
#1 lore raw

PATCH 1/1 igb: fix itnull.cocci warnings

Quoted 8 lines

From: Intel-wired-lan [intel-wired-lan-bounces at lists.osuosl.org] on behalf of Julia Lawall [julia.lawall at lip6.fr]
Sent: Wednesday, December 23, 2015 4:52 AM
To: Gangfeng Huang
Cc: intel-wired-lan at lists.osuosl.org; kbuild-all at 01.org
Subject: [Intel-wired-lan] [PATCH] igb: fix itnull.cocci warnings

The index variable of list_for_each_entry_safe should never be NULL.

Quoted 8 lines

Generated by: scripts/coccinelle/iterators/itnull.cocci

CC Gangfeng Huang <[email protected]>

---

 igb_cdev.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)