diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_base.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_base.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c index d84874492cbf..1f22a764927a 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_base.c +++ b/drivers/scsi/mpt2sas/mpt2sas_base.c | |||
@@ -3668,12 +3668,14 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3668 | 3668 | ||
3669 | /* ctl module internal command bits */ | 3669 | /* ctl module internal command bits */ |
3670 | ioc->ctl_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); | 3670 | ioc->ctl_cmds.reply = kzalloc(ioc->reply_sz, GFP_KERNEL); |
3671 | ioc->ctl_cmds.sense = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL); | ||
3671 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; | 3672 | ioc->ctl_cmds.status = MPT2_CMD_NOT_USED; |
3672 | mutex_init(&ioc->ctl_cmds.mutex); | 3673 | mutex_init(&ioc->ctl_cmds.mutex); |
3673 | 3674 | ||
3674 | if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply || | 3675 | if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply || |
3675 | !ioc->scsih_cmds.reply || !ioc->tm_cmds.reply || | 3676 | !ioc->scsih_cmds.reply || !ioc->tm_cmds.reply || |
3676 | !ioc->config_cmds.reply || !ioc->ctl_cmds.reply) { | 3677 | !ioc->config_cmds.reply || !ioc->ctl_cmds.reply || |
3678 | !ioc->ctl_cmds.sense) { | ||
3677 | r = -ENOMEM; | 3679 | r = -ENOMEM; |
3678 | goto out_free_resources; | 3680 | goto out_free_resources; |
3679 | } | 3681 | } |
@@ -3722,6 +3724,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) | |||
3722 | kfree(ioc->config_cmds.reply); | 3724 | kfree(ioc->config_cmds.reply); |
3723 | kfree(ioc->base_cmds.reply); | 3725 | kfree(ioc->base_cmds.reply); |
3724 | kfree(ioc->ctl_cmds.reply); | 3726 | kfree(ioc->ctl_cmds.reply); |
3727 | kfree(ioc->ctl_cmds.sense); | ||
3725 | kfree(ioc->pfacts); | 3728 | kfree(ioc->pfacts); |
3726 | ioc->ctl_cmds.reply = NULL; | 3729 | ioc->ctl_cmds.reply = NULL; |
3727 | ioc->base_cmds.reply = NULL; | 3730 | ioc->base_cmds.reply = NULL; |
@@ -3754,6 +3757,7 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc) | |||
3754 | kfree(ioc->pd_handles); | 3757 | kfree(ioc->pd_handles); |
3755 | kfree(ioc->pfacts); | 3758 | kfree(ioc->pfacts); |
3756 | kfree(ioc->ctl_cmds.reply); | 3759 | kfree(ioc->ctl_cmds.reply); |
3760 | kfree(ioc->ctl_cmds.sense); | ||
3757 | kfree(ioc->base_cmds.reply); | 3761 | kfree(ioc->base_cmds.reply); |
3758 | kfree(ioc->tm_cmds.reply); | 3762 | kfree(ioc->tm_cmds.reply); |
3759 | kfree(ioc->transport_cmds.reply); | 3763 | kfree(ioc->transport_cmds.reply); |