ice: Don't use GFP_KERNEL in atomic context
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 16 Jan 2022 18:46:20 +0000 (19:46 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 8 Mar 2022 21:31:09 +0000 (13:31 -0800)
ice_misc_intr() is an irq handler. It should not sleep.

Use GFP_ATOMIC instead of GFP_KERNEL when allocating some memory.

Fixes: 348048e724a0 ("ice: Implement iidc operations")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Tested-by: Leszek Kaliszczuk <leszek.kaliszczuk@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_main.c

index 6fc6514eb0074f73f83f06c9616812b2b0da166d..83e3e8aae6cfcc15d52e3daacb5f5e75785af08a 100644 (file)
@@ -3034,7 +3034,7 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data)
                struct iidc_event *event;
 
                ena_mask &= ~ICE_AUX_CRIT_ERR;
-               event = kzalloc(sizeof(*event), GFP_KERNEL);
+               event = kzalloc(sizeof(*event), GFP_ATOMIC);
                if (event) {
                        set_bit(IIDC_EVENT_CRIT_ERR, event->type);
                        /* report the entire OICR value to AUX driver */