Skip to content

Commit 374f78f

Browse files
XidianGeneralJeff Kirsher
authored andcommitted
ixgbe: Replace GFP_ATOMIC with GFP_KERNEL
ixgbe_fcoe_ddp_setup(), ixgbe_setup_fcoe_ddp_resources() and ixgbe_sw_init() are never called in atomic context. They call kmalloc(), dma_pool_alloc() and kzalloc() 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> Acked-by: Sebastian Basierski <sebastianx.basierski@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
1 parent 69a6465 commit 374f78f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int ixgbe_fcoe_ddp_setup(struct net_device *netdev, u16 xid,
192192
}
193193

194194
/* alloc the udl from per cpu ddp pool */
195-
ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_ATOMIC, &ddp->udp);
195+
ddp->udl = dma_pool_alloc(ddp_pool->pool, GFP_KERNEL, &ddp->udp);
196196
if (!ddp->udl) {
197197
e_err(drv, "failed allocated ddp context\n");
198198
goto out_noddp_unmap;
@@ -760,7 +760,7 @@ int ixgbe_setup_fcoe_ddp_resources(struct ixgbe_adapter *adapter)
760760
return 0;
761761

762762
/* Extra buffer to be shared by all DDPs for HW work around */
763-
buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_ATOMIC);
763+
buffer = kmalloc(IXGBE_FCBUFF_MIN, GFP_KERNEL);
764764
if (!buffer)
765765
return -ENOMEM;
766766

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6201,7 +6201,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter,
62016201

62026202
adapter->mac_table = kcalloc(hw->mac.num_rar_entries,
62036203
sizeof(struct ixgbe_mac_addr),
6204-
GFP_ATOMIC);
6204+
GFP_KERNEL);
62056205
if (!adapter->mac_table)
62066206
return -ENOMEM;
62076207

0 commit comments

Comments
 (0)