mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-26 15:40:53 +07:00
qlcnic: protect resoruce cleanup by rtnl lock
o context resources can be in used, while resoruce cleanup is in progress, during fw recover. o Null pointer execption can occur in send_cmd_desc, if fw recovery module frees tx ring without rtnl lock. o Same applies to ethtool register dump and FW health registers should be dump in any case. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
1b95a83958
commit
ce6684433f
@ -326,12 +326,12 @@ qlcnic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
|
|||||||
regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) |
|
regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) |
|
||||||
(adapter->pdev)->device;
|
(adapter->pdev)->device;
|
||||||
|
|
||||||
if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (i = 0; diag_registers[i] != -1; i++)
|
for (i = 0; diag_registers[i] != -1; i++)
|
||||||
regs_buff[i] = QLCRD32(adapter, diag_registers[i]);
|
regs_buff[i] = QLCRD32(adapter, diag_registers[i]);
|
||||||
|
|
||||||
|
if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)
|
||||||
|
return;
|
||||||
|
|
||||||
regs_buff[i++] = 0xFFEFCDAB; /* Marker btw regs and ring count*/
|
regs_buff[i++] = 0xFFEFCDAB; /* Marker btw regs and ring count*/
|
||||||
|
|
||||||
regs_buff[i++] = 1; /* No. of tx ring */
|
regs_buff[i++] = 1; /* No. of tx ring */
|
||||||
|
@ -2051,7 +2051,9 @@ qlcnic_detach_work(struct work_struct *work)
|
|||||||
|
|
||||||
qlcnic_down(adapter, netdev);
|
qlcnic_down(adapter, netdev);
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
qlcnic_detach(adapter);
|
qlcnic_detach(adapter);
|
||||||
|
rtnl_unlock();
|
||||||
|
|
||||||
status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1);
|
status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user