summaryrefslogtreecommitdiff
path: root/drivers/scsi/qla2xxx/qla_isr.c
diff options
context:
space:
mode:
authorChad Dupuis <chad.dupuis@qlogic.com>2012-05-15 18:34:14 (GMT)
committerJames Bottomley <JBottomley@Parallels.com>2012-05-22 10:25:50 (GMT)
commit9a347ff404d786d044ed09a4ec9a38ca70e8c803 (patch)
tree699ff5a897129337de90f7439948b7b54f441195 /drivers/scsi/qla2xxx/qla_isr.c
parent01b6585d8af737a82b45ca22a938f2a930659775 (diff)
downloadlinux-9a347ff404d786d044ed09a4ec9a38ca70e8c803.tar.xz
[SCSI] qla2xxx: Handle interrupt registration failures more gracefully.
If interrupt registration failed we could crash the machine as we were trying to deference some pointers which weren't allocated yet. Move the allocation a little earlier and make some checks to the free resource code to make sure that we don't try to free a resource that was never allocated. Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ce42288..f4b8a5f 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2564,7 +2564,15 @@ void
qla2x00_free_irqs(scsi_qla_host_t *vha)
{
struct qla_hw_data *ha = vha->hw;
- struct rsp_que *rsp = ha->rsp_q_map[0];
+ struct rsp_que *rsp;
+
+ /*
+ * We need to check that ha->rsp_q_map is valid in case we are called
+ * from a probe failure context.
+ */
+ if (!ha->rsp_q_map || !ha->rsp_q_map[0])
+ return;
+ rsp = ha->rsp_q_map[0];
if (ha->flags.msix_enabled)
qla24xx_disable_msix(ha);