projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ae21cf9
)
drivers/char/rio/rioctrl.c: off by one error in rioctrl.c
author
Dan Carpenter
<
[email protected]
>
Wed, 23 Sep 2009 22:57:14 +0000
(15:57 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 24 Sep 2009 14:21:03 +0000
(07:21 -0700)
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 <
[email protected]
>
Cc: Jiri Slaby <
[email protected]
>
Cc: Alan Cox <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/char/rio/rioctrl.c
patch
|
blob
|
history
diff --git
a/drivers/char/rio/rioctrl.c
b/drivers/char/rio/rioctrl.c
index eecee0f576d2d7eea772b574ebac97ec33db04f4..74339559f0b9a3be4a768c5ef1f65d4cc8b3ca58 100644
(file)
--- 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;