Skip to content
Commit d02327a8 authored by Chad Dupuis's avatar Chad Dupuis Committed by Martin K. Petersen
Browse files

bnx2fc: Check sc_cmd device and host pointer before returning the command to the mid-layer.



When we are in connection recovery and the internal command timer on a
request pops, either the scsi_cmnd->device or scsi_cmnd->device->host
back pointers may be NULL as the device that the command that the
request was submitted on may have been subsequently reaped due to the
connection recovery. This can cause one or both of the pointers above to
be NULL and cause a system crash if we try to return the command to the
midlayer.

Instead, double check the pointers before the return to the midlayer so
as to prevent the crash and let the upper layers finish the session
recovery and rediscover the device.

Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent f72464d1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment