From: Chad Dupuis Date: Thu, 9 Feb 2012 19:14:04 +0000 (-0800) Subject: [SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=aa651be83dfec5587dabce0a9d471c1e2095c33e;p=linux-beck.git [SCSI] qla2xxx: Add check for null fcport references in qla2xxx_queuecommand. Signed-off-by: Giridhar Malavali Signed-off-by: Chad Dupuis Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index b4b185c7bad6..5fd89d761688 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) cmd->result = DID_NO_CONNECT << 16; goto qc24_fail_command; } + + if (!fcport) { + cmd->result = DID_NO_CONNECT << 16; + goto qc24_fail_command; + } + if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || atomic_read(&base_vha->loop_state) == LOOP_DEAD) {