aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/rio/rioctrl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index 052e8120a471..7ce77619707c 100644
--- 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
662 p->RIOError.Error = COPYIN_FAILED; 662 p->RIOError.Error = COPYIN_FAILED;
663 return -EFAULT; 663 return -EFAULT;
664 } 664 }
665 if (portStats.port >= RIO_PORTS) { 665 if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
666 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; 666 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
667 return -ENXIO; 667 return -ENXIO;
668 } 668 }
@@ -702,7 +702,7 @@ int riocontrol(struct rio_info *p, dev_t dev, int cmd, unsigned long arg, int su
702 p->RIOError.Error = COPYIN_FAILED; 702 p->RIOError.Error = COPYIN_FAILED;
703 return -EFAULT; 703 return -EFAULT;
704 } 704 }
705 if (portStats.port >= RIO_PORTS) { 705 if (portStats.port < 0 || portStats.port >= RIO_PORTS) {
706 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE; 706 p->RIOError.Error = PORT_NUMBER_OUT_OF_RANGE;
707 return -ENXIO; 707 return -ENXIO;
708 } 708 }