aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-09-23 18:57:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-24 10:21:03 -0400
commit459ca8b4ed1889b0a69bbe21888e6af136d495f3 (patch)
treec83e78fe8da1c42e45ea5fcdbee2b93469f2bf3b /drivers/char
parentae21cf9248584d9b3776bfe2ebec47256bf098f8 (diff)
drivers/char/rio/rioctrl.c: off by one error in rioctrl.c
If DownLoad.ProductCode == MAX_PRODUCT, that would be a problem when we do RIOBootTable[DownLoad.ProductCode] a couple lines down. Found by smatch (http://repo.or.cz/w/smatch.git). Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Jiri Slaby <jirislaby@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/rio/rioctrl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index eecee0f576d2..74339559f0b9 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -873,7 +873,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
873 /* 873 /*
874 ** It is important that the product code is an unsigned object! 874 ** It is important that the product code is an unsigned object!
875 */ 875 */
876 if (DownLoad.ProductCode > MAX_PRODUCT) { 876 if (DownLoad.ProductCode >= MAX_PRODUCT) {
877 rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Bad product code %d passed\n", DownLoad.ProductCode); 877 rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Bad product code %d passed\n", DownLoad.ProductCode);
878 p->RIOError.Error = NO_SUCH_PRODUCT; 878 p->RIOError.Error = NO_SUCH_PRODUCT;
879 return -ENXIO; 879 return -ENXIO;