Skip to contentSkip to conversation

mpt2sas: New feature - Fast Load Support

SCSI Dan Carpenter 2 participants 2 messages Nov 3, 2011 – Nov 4, 2011 SCSI

lore
Share & tools
lore
#0 lore raw

Hello [email protected],

This is a semi-automatic email about new static checker warnings.

The patch 921cd8024b90: "[SCSI] mpt2sas: New feature - Fast Load Support" from Oct 19, 2011, leads to the following Smatch complaint:

drivers/scsi/mpt2sas/mpt2sas_base.c +3506 mpt2sas_port_enable_done()
error: we previously assumed 'mpi_reply' could be null (see line 3499)

drivers/scsi/mpt2sas/mpt2sas_base.c
3498 ioc->port_enable_cmds.status |= MPT2_CMD_COMPLETE;

  3499		if (mpi_reply) {
                    ^^^^^^^^^

check.

3500 ioc->port_enable_cmds.status |= MPT2_CMD_REPLY_VALID;
3501 memcpy(ioc->port_enable_cmds.reply, mpi_reply,
3502 mpi_reply->MsgLength*4);
3503 }
3504 ioc->port_enable_cmds.status &= ~MPT2_CMD_PENDING;
3505

  3506		ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
                                         ^^^^^^^^^^^

dereference.

3507
3508 if (ioc_status != MPI2_IOCSTATUS_SUCCESS)

regards,
dan carpenter

#1 lore raw

Thank you for the feedback. Will post a fix.

Regards,
Nagalakshmi

-----Original Message-----
From: Dan Carpenter [mailto:[email protected]]
Sent: Thursday, November 03, 2011 5:50 PM
To: Nandigama, Nagalakshmi
Cc: [email protected]
Subject: re: [SCSI] mpt2sas: New feature - Fast Load Support

Hello [email protected],

This is a semi-automatic email about new static checker warnings.

The patch 921cd8024b90: "[SCSI] mpt2sas: New feature - Fast Load Support" from Oct 19, 2011, leads to the following Smatch complaint:

drivers/scsi/mpt2sas/mpt2sas_base.c +3506 mpt2sas_port_enable_done()
error: we previously assumed 'mpi_reply' could be null (see line 3499)

drivers/scsi/mpt2sas/mpt2sas_base.c
3498 ioc->port_enable_cmds.status |= MPT2_CMD_COMPLETE;

  3499		if (mpi_reply) {
                    ^^^^^^^^^

check.

3500 ioc->port_enable_cmds.status |= MPT2_CMD_REPLY_VALID;
3501 memcpy(ioc->port_enable_cmds.reply, mpi_reply,
3502 mpi_reply->MsgLength*4);
3503 }
3504 ioc->port_enable_cmds.status &= ~MPT2_CMD_PENDING;
3505

  3506		ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
                                         ^^^^^^^^^^^

dereference.

3507
3508 if (ioc_status != MPI2_IOCSTATUS_SUCCESS)

regards,
dan carpenter