diff options
author | Dan Carpenter <error27@gmail.com> | 2009-09-23 15:57:14 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 07:21:03 -0700 |
commit | 459ca8b4ed1889b0a69bbe21888e6af136d495f3 (patch) | |
tree | c83e78fe8da1c42e45ea5fcdbee2b93469f2bf3b /drivers/char/rio | |
parent | ae21cf9248584d9b3776bfe2ebec47256bf098f8 (diff) | |
download | linux-459ca8b4ed1889b0a69bbe21888e6af136d495f3.tar.bz2 |
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/rio')
-rw-r--r-- | drivers/char/rio/rioctrl.c | 2 |
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 /* ** It is important that the product code is an unsigned object! */ - if (DownLoad.ProductCode > MAX_PRODUCT) { + if (DownLoad.ProductCode >= MAX_PRODUCT) { rio_dprintk(RIO_DEBUG_CTRL, "RIO_DOWNLOAD: Bad product code %d passed\n", DownLoad.ProductCode); p->RIOError.Error = NO_SUCH_PRODUCT; return -ENXIO; |