Re: [PATCH] scsi: mpt2sas: mpt2sas_base.c: Fix for possible null pointer dereference

From: Joe Lawrence
Date: Thu Jul 03 2014 - 14:09:17 EST


On Wed, 28 May 2014, Christoph Hellwig wrote:

> > - ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
> > + if (mpi_reply) {
> > + ioc_status = le16_to_cpu(mpi_reply->IOCStatus) & MPI2_IOCSTATUS_MASK;
> > + }
> >
> > if (ioc_status != MPI2_IOCSTATUS_SUCCESS)
> > ioc->port_enable_failed = 1;
>
> ioc_status isn't initialized without the reply and used here as well
> as later in the function. I think we'll need input from LSI or others
> with the spec on what to do when we didn't get a reply.

Any update on this?

The mpt3 version checks for !mpi_reply and returns 1. Which leads to
another question -- should mpt{2,3}sas_port_enable_done ever return 0 (as their
respective comments describe)?

Regards,

-- Joe
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/