]> git.baikalelectronics.ru Git - kernel.git/commitdiff
igb: Fix position of assignment to *ring
authorJedrzej Jagielski <jedrzej.jagielski@intel.com>
Fri, 11 Jun 2021 22:42:17 +0000 (22:42 +0000)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 1 Jul 2021 17:59:21 +0000 (10:59 -0700)
Assignment to *ring should be done after correctness check of the
argument queue.

Fixes: 17be50cfd261 ("igb: Refactor igb_configure_cbs()")
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/igb/igb_main.c

index 9470ba8914837c60450406c2db1f5f6bbc76fb1f..171a7a629b203b601d1030ed2ff6248faab73d9c 100644 (file)
@@ -1685,14 +1685,15 @@ static bool is_any_txtime_enabled(struct igb_adapter *adapter)
  **/
 static void igb_config_tx_modes(struct igb_adapter *adapter, int queue)
 {
-       struct igb_ring *ring = adapter->tx_ring[queue];
        struct net_device *netdev = adapter->netdev;
        struct e1000_hw *hw = &adapter->hw;
+       struct igb_ring *ring;
        u32 tqavcc, tqavctrl;
        u16 value;
 
        WARN_ON(hw->mac.type != e1000_i210);
        WARN_ON(queue < 0 || queue > 1);
+       ring = adapter->tx_ring[queue];
 
        /* If any of the Qav features is enabled, configure queues as SR and
         * with HIGH PRIO. If none is, then configure them with LOW PRIO and