scsi: ibmvscsis: Fixed a bug reported by Dan Carpenter
authorBryant G. Ly <bryantly@linux.vnet.ibm.com>
Wed, 31 Aug 2016 16:29:01 +0000 (11:29 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Sun, 4 Sep 2016 05:28:07 +0000 (01:28 -0400)
SUPPORTED_FORMATS is 1 << 1 so it's never zero.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Signed-off-by: Michael Cyr <mikecyr@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c

index f3c997f..4dd8e5e 100644 (file)
@@ -1978,7 +1978,7 @@ static long ibmvscsis_srp_login(struct scsi_info *vscsi,
                reason = SRP_LOGIN_REJ_MULTI_CHANNEL_UNSUPPORTED;
        else if (fmt->buffers & (~SUPPORTED_FORMATS))
                reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
-       else if ((fmt->buffers | SUPPORTED_FORMATS) == 0)
+       else if ((fmt->buffers & SUPPORTED_FORMATS) == 0)
                reason = SRP_LOGIN_REJ_UNSUPPORTED_DESCRIPTOR_FMT;
 
        if (vscsi->state == SRP_PROCESSING)