Skip to content

Commit 1513562

Browse files
XidianGeneralJeff Kirsher
authored andcommitted
igb: Replace GFP_ATOMIC with GFP_KERNEL in igb_sw_init()
igb_sw_init() is never called in atomic context. It calls kzalloc() and kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent a798fba commit 1513562

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,7 +3873,7 @@ static int igb_sw_init(struct igb_adapter *adapter)
38733873

38743874
adapter->mac_table = kcalloc(hw->mac.rar_entry_count,
38753875
sizeof(struct igb_mac_addr),
3876-
GFP_ATOMIC);
3876+
GFP_KERNEL);
38773877
if (!adapter->mac_table)
38783878
return -ENOMEM;
38793879

@@ -3883,7 +3883,7 @@ static int igb_sw_init(struct igb_adapter *adapter)
38833883

38843884
/* Setup and initialize a copy of the hw vlan table array */
38853885
adapter->shadow_vfta = kcalloc(E1000_VLAN_FILTER_TBL_SIZE, sizeof(u32),
3886-
GFP_ATOMIC);
3886+
GFP_KERNEL);
38873887
if (!adapter->shadow_vfta)
38883888
return -ENOMEM;
38893889

0 commit comments

Comments
 (0)