igb: resolve panic on shutdown when SR-IOV is enabled

The setup_rctl call was making a call into the ring structure after it had
been freed. This was causing a panic on shutdown. This call wasn't
necessary since it is possible to get the needed index from
adapter->vfs_allocated_count.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Alexander Duyck and committed by David S. Miller 77a22941 a860820d

+5 -7
+5 -7
drivers/net/igb/igb_main.c
··· 2006 2006 struct e1000_hw *hw = &adapter->hw; 2007 2007 u32 rctl; 2008 2008 u32 srrctl = 0; 2009 - int i, j; 2009 + int i; 2010 2010 2011 2011 rctl = rd32(E1000_RCTL); 2012 2012 ··· 2071 2071 if (adapter->vfs_allocated_count) { 2072 2072 u32 vmolr; 2073 2073 2074 - j = adapter->rx_ring[0].reg_idx; 2075 - 2076 2074 /* set all queue drop enable bits */ 2077 2075 wr32(E1000_QDE, ALL_QUEUES); 2078 2076 srrctl |= E1000_SRRCTL_DROP_EN; ··· 2078 2080 /* disable queue 0 to prevent tail write w/o re-config */ 2079 2081 wr32(E1000_RXDCTL(0), 0); 2080 2082 2081 - vmolr = rd32(E1000_VMOLR(j)); 2083 + vmolr = rd32(E1000_VMOLR(adapter->vfs_allocated_count)); 2082 2084 if (rctl & E1000_RCTL_LPE) 2083 2085 vmolr |= E1000_VMOLR_LPE; 2084 - if (adapter->num_rx_queues > 0) 2086 + if (adapter->num_rx_queues > 1) 2085 2087 vmolr |= E1000_VMOLR_RSSE; 2086 - wr32(E1000_VMOLR(j), vmolr); 2088 + wr32(E1000_VMOLR(adapter->vfs_allocated_count), vmolr); 2087 2089 } 2088 2090 2089 2091 for (i = 0; i < adapter->num_rx_queues; i++) { 2090 - j = adapter->rx_ring[i].reg_idx; 2092 + int j = adapter->rx_ring[i].reg_idx; 2091 2093 wr32(E1000_SRRCTL(j), srrctl); 2092 2094 } 2093 2095