git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
drivers
/
char
/
rio
/
rioctrl.c
diff --git
a/drivers/char/rio/rioctrl.c
b/drivers/char/rio/rioctrl.c
index
052e812
..
7ce7761
100644
(file)
--- a/
drivers/char/rio/rioctrl.c
+++ b/
drivers/char/rio/rioctrl.c
@@
-662,7
+662,7
@@
int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
- if (portStats.port >= RIO_PORTS) {
+ if (portStats.port
< 0 || portStats.port
>= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}
@@
-702,7
+702,7
@@
int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
p->RIOError.Error = COPYIN_FAILED;
return -EFAULT;
}
- if (portStats.port >= RIO_PORTS) {
+ if (portStats.port
< 0 || portStats.port
>= RIO_PORTS) {
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}
p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
return -ENXIO;
}