* [PATCH] st: fix test of value range in st_set_options()
@ 2009-08-25 13:14 Roel Kluin
0 siblings, 0 replies; only message in thread
From: Roel Kluin @ 2009-08-25 13:14 UTC (permalink / raw)
To: James E.J. Bottomley, linux-scsi, Andrew Morton
value cannot logically be less than START and greater than BUFFERSIZE.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
// vi drivers/scsi/st.h +215
#define EXTENDED_SENSE_START 18
// vi include/scsi/scsi_cmnd.h +105
#define SCSI_SENSE_BUFFERSIZE 96
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index b33d042..cb79e39 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -2280,7 +2280,7 @@ 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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-08-25 13:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-25 13:14 [PATCH] st: fix test of value range in st_set_options() Roel Kluin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.