Mike,

On May 31, 2012, at 8:16 PM, Mike Christie wrote:

> On 05/31/2012 07:14 PM, Mark Rustad wrote:
>> Signed-off-by: Mark Rustad <mark.d.rus...@intel.com>
>> Tested-by: Marcus Dennis <marcusx.e.den...@intel.com>
>> ---
>> 
>> include/scsi/scsi_cmnd.h |    8 +++++++-
>> 1 files changed, 7 insertions(+), 1 deletions(-)
>> 
>> diff --git a/include/scsi/scsi_cmnd.h b/include/scsi/scsi_cmnd.h
>> index 1e11985..ac06cc5 100644
>> --- a/include/scsi/scsi_cmnd.h
>> +++ b/include/scsi/scsi_cmnd.h
>> @@ -134,10 +134,16 @@ struct scsi_cmnd {
>> 
>> static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
>> {
>> +    struct scsi_driver **sdp;
>> +
>>      if (!cmd->request->rq_disk)
>>              return NULL;
>> 
>> -    return *(struct scsi_driver **)cmd->request->rq_disk->private_data;
>> +    sdp = (struct scsi_driver **)cmd->request->rq_disk->private_data;
>> +    if (!sdp)
>> +            return NULL;
>> +
>> +    return *sdp;
>> }
> 
> Upstream commit:
> 
> Author: Martin K. Petersen <martin.peter...@oracle.com>
> Date:   Sat Apr 14 23:01:28 2012 -0400
> 
>    SCSI: Fix error handling when no ULD is attached
> 
> should fix this.


If you look closely, you will see that this patch applies on top of that patch. 
Martin's patch addressed the possibility of rq_disk being NULL. This patch adds 
checking private_data for NULL before dereferencing it.

I will resend the patch with a better commit message and the backtrace related 
to the failure that this fixes.

-- 
Mark Rustad, LAN Access Division, Intel Corporation

_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to