Merge branch 'for-linus' of git://gitorious.org/linux-omap-dss2/linux
[pandora-kernel.git] / drivers / scsi / st.c
index 12d58a7..ad59abb 100644 (file)
@@ -2280,7 +2280,8 @@ static int st_set_options(struct scsi_tape *STp, long options)
        } else if (code == MT_ST_SET_CLN) {
                value = (options & ~MT_ST_OPTIONS) & 0xff;
                if (value != 0 &&
-                   value < EXTENDED_SENSE_START && value >= SCSI_SENSE_BUFFERSIZE)
+                       (value < EXTENDED_SENSE_START ||
+                               value >= SCSI_SENSE_BUFFERSIZE))
                        return (-EINVAL);
                STp->cln_mode = value;
                STp->cln_sense_mask = (options >> 8) & 0xff;