scsi: mpt3sas: Fix memory allocation failure test in 'mpt3sas_base_attach()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 6 Aug 2017 22:51:29 +0000 (00:51 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 10 Aug 2017 23:36:51 +0000 (19:36 -0400)
In the lines above this test, 8 'kzalloc' are performed, but only 7
results are tested.

Add the missing one (i.e. '!ioc->port_enable_cmds.reply').

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpt3sas/mpt3sas_base.c

index 1a5b6e40fb5c55065c086a6fa4eb8e7393d8e08d..8a44636ab0b5b32d8c7b60b3155820125a9b1524 100644 (file)
@@ -5494,10 +5494,10 @@ mpt3sas_base_attach(struct MPT3SAS_ADAPTER *ioc)
        ioc->ctl_cmds.status = MPT3_CMD_NOT_USED;
        mutex_init(&ioc->ctl_cmds.mutex);
 
-       if (!ioc->base_cmds.reply || !ioc->transport_cmds.reply ||
-           !ioc->scsih_cmds.reply || !ioc->tm_cmds.reply ||
-           !ioc->config_cmds.reply || !ioc->ctl_cmds.reply ||
-           !ioc->ctl_cmds.sense) {
+       if (!ioc->base_cmds.reply || !ioc->port_enable_cmds.reply ||
+           !ioc->transport_cmds.reply || !ioc->scsih_cmds.reply ||
+           !ioc->tm_cmds.reply || !ioc->config_cmds.reply ||
+           !ioc->ctl_cmds.reply || !ioc->ctl_cmds.sense) {
                r = -ENOMEM;
                goto out_free_resources;
        }