]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bnx2fc: Check sc_cmd device and host pointer before returning the command to the...
authorChad Dupuis <chad.dupuis@qlogic.com>
Thu, 7 Apr 2016 13:07:59 +0000 (09:07 -0400)
committerChuck Anderson <chuck.anderson@oracle.com>
Mon, 12 Dec 2016 01:49:03 +0000 (17:49 -0800)
commit036b465f39e6a8c3f15987fc3b4149c1ed39de42
tree997289bb0ce547ca7f1938a7407178e41b61a493
parent984862e11774e9ce706af29aee4fde55ae8304ef
bnx2fc: Check sc_cmd device and host pointer before returning the command to the mid-layer.

Orabug: 24011326

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: Chad Dupuis <chad.dupuis@qlogic.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Ethan Zhao <ethan.zhao@oracle.com>
drivers/scsi/bnx2fc/bnx2fc_io.c