diff options
Diffstat (limited to 'drivers/scsi/mpt2sas')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index 6f786349679f..6c384dac5ec5 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -3580,8 +3580,10 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3580 | 3580 | ||
3581 | ioc->pfacts = kcalloc(ioc->facts.NumberOfPorts, | 3581 | ioc->pfacts = kcalloc(ioc->facts.NumberOfPorts, |
3582 | sizeof(Mpi2PortFactsReply_t), GFP_KERNEL); | 3582 | sizeof(Mpi2PortFactsReply_t), GFP_KERNEL); |
3583 | if (!ioc->pfacts) | 3583 | if (!ioc->pfacts) { |
3584 | r = -ENOMEM; | ||
3584 | goto out_free_resources; | 3585 | goto out_free_resources; |
3586 | } | ||
3585 | 3587 | ||
3586 | for (i = 0 ; i < ioc->facts.NumberOfPorts; i++) { | 3588 | for (i = 0 ; i < ioc->facts.NumberOfPorts; i++) { |
3587 | r = _base_get_port_facts(ioc, i, CAN_SLEEP); | 3589 | r = _base_get_port_facts(ioc, i, CAN_SLEEP); |
@@ -3627,6 +3629,13 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3627 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; | 3629 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; |
3628 | mutex_init(&ioc->ctl_cmds.mutex); | 3630 | mutex_init(&ioc->ctl_cmds.mutex); |
3629 | 3631 | ||
3632 | if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply || | ||
3633 | !ioc->scsih_cmds.reply || !ioc->tm_cmds.reply || | ||
3634 | !ioc->config_cmds.reply || !ioc->ctl_cmds.reply) { | ||
3635 | r = -ENOMEM; | ||
3636 | goto out_free_resources; | ||
3637 | } | ||
3638 | |||
3630 | init_completion(&ioc->shost_recovery_done); | 3639 | init_completion(&ioc->shost_recovery_done); |
3631 | 3640 | ||
3632 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) | 3641 | for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++) |