]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iavf: Fix missing check for running netdev
authorSlawomir Laba <slawomirx.laba@intel.com>
Wed, 23 Feb 2022 12:38:43 +0000 (13:38 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Fri, 25 Feb 2022 19:37:08 +0000 (11:37 -0800)
The driver was queueing reset_task regardless of the netdev
state.

Do not queue the reset task in iavf_change_mtu if netdev
is not running.

Fixes: fdd4044ffdc8 ("iavf: Remove timer for work triggering, use delaying work instead")
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Phani Burra <phani.r.burra@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c

index da50ea3e44c26bed8e88a70fb94554187d9c7d29..be97ac25180224f8257ca2ff6a18b08de936acf1 100644 (file)
@@ -3905,8 +3905,11 @@ static int iavf_change_mtu(struct net_device *netdev, int new_mtu)
                iavf_notify_client_l2_params(&adapter->vsi);
                adapter->flags |= IAVF_FLAG_SERVICE_CLIENT_REQUESTED;
        }
-       adapter->flags |= IAVF_FLAG_RESET_NEEDED;
-       queue_work(iavf_wq, &adapter->reset_task);
+
+       if (netif_running(netdev)) {
+               adapter->flags |= IAVF_FLAG_RESET_NEEDED;
+               queue_work(iavf_wq, &adapter->reset_task);
+       }
 
        return 0;
 }