aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-02-01 00:24:57 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-02 18:55:45 -0500
commitce6684433fb277406dd861fd8a17133253e7c367 (patch)
treed3734121875c91d01d37e448da2d1c34ba7c274a /drivers/net/qlcnic
parent1b95a839587f40abab2f9cb3e5254dc821b9829b (diff)
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>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c6
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 65e9620e28f1..37df5f6cea08 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -326,12 +326,12 @@ qlcnic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
326 regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) | 326 regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) |
327 (adapter->pdev)->device; 327 (adapter->pdev)->device;
328 328
329 if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)
330 return;
331
332 for (i = 0; diag_registers[i] != -1; i++) 329 for (i = 0; diag_registers[i] != -1; i++)
333 regs_buff[i] = QLCRD32(adapter, diag_registers[i]); 330 regs_buff[i] = QLCRD32(adapter, diag_registers[i]);
334 331
332 if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC)
333 return;
334
335 regs_buff[i++] = 0xFFEFCDAB; /* Marker btw regs and ring count*/ 335 regs_buff[i++] = 0xFFEFCDAB; /* Marker btw regs and ring count*/
336 336
337 regs_buff[i++] = 1; /* No. of tx ring */ 337 regs_buff[i++] = 1; /* No. of tx ring */
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 9a98285ee791..7259adc32631 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2051,7 +2051,9 @@ qlcnic_detach_work(struct work_struct *work)
2051 2051
2052 qlcnic_down(adapter, netdev); 2052 qlcnic_down(adapter, netdev);
2053 2053
2054 rtnl_lock();
2054 qlcnic_detach(adapter); 2055 qlcnic_detach(adapter);
2056 rtnl_unlock();
2055 2057
2056 status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1); 2058 status = QLCRD32(adapter, QLCNIC_PEG_HALT_STATUS1);
2057 2059