aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/applicom.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c
index 31d08b641f5b..b899d9182c7d 100644
--- a/drivers/char/applicom.c
+++ b/drivers/char/applicom.c
@@ -712,8 +712,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
712 712
713 IndexCard = adgl->num_card-1; 713 IndexCard = adgl->num_card-1;
714 714
715 if(cmd != 0 && cmd != 6 && 715 if(cmd != 6 && ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
716 ((IndexCard >= MAX_BOARD) || !apbs[IndexCard].RamIO)) {
717 static int warncount = 10; 716 static int warncount = 10;
718 if (warncount) { 717 if (warncount) {
719 printk( KERN_WARNING "APPLICOM driver IOCTL, bad board number %d\n",(int)IndexCard+1); 718 printk( KERN_WARNING "APPLICOM driver IOCTL, bad board number %d\n",(int)IndexCard+1);
@@ -832,8 +831,7 @@ static int ac_ioctl(struct inode *inode, struct file *file, unsigned int cmd, un
832 } 831 }
833 break; 832 break;
834 default: 833 default:
835 printk(KERN_INFO "APPLICOM driver ioctl, unknown function code %d\n",cmd) ; 834 ret = -ENOTTY;
836 ret = -EINVAL;
837 break; 835 break;
838 } 836 }
839 Dummy = readb(apbs[IndexCard].RamIO + VERS); 837 Dummy = readb(apbs[IndexCard].RamIO + VERS);