[SCSI] qla2xxx: Don't issue set or get port param MBC if remote port is not logged in
authorMadhuranath Iyengar <madhuranath.iyengar@qlogic.com>
Fri, 23 Jul 2010 10:28:31 +0000 (15:28 +0500)
committerJames Bottomley <James.Bottomley@suse.de>
Wed, 28 Jul 2010 14:06:12 +0000 (09:06 -0500)
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/qla2xxx/qla_bsg.c

index d551ae19d4e1c50f902d43dbba43a3cb58192ce0..518fccfbfdb227d4efc1252f518f697407045cb6 100644 (file)
@@ -1259,6 +1259,13 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
                return -EINVAL;
        }
 
+       if (fcport->flags & FCF_LOGIN_NEEDED) {
+               DEBUG2(printk(KERN_ERR "%s(%ld): Remote port not logged in, "
+                   "flags = 0x%x\n",
+                   __func__, vha->host_no, fcport->flags));
+               return -EINVAL;
+       }
+
        if (port_param->mode)
                rval = qla2x00_set_idma_speed(vha, fcport->loop_id,
                        port_param->speed, mb);