Commit 095d030c authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Linus Torvalds

[PATCH] Off-by-one in drivers/char/mwave/mwavedd.c

This fixes two off by ones in the mwave driver, found
via find -iname \*.[ch] | xargs grep "> ARRAY_SIZE("
Signed-off-by: default avatarEric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1cfee2b3
...@@ -297,7 +297,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file, ...@@ -297,7 +297,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
" ipcnum %x, usIntCount %x\n", " ipcnum %x, usIntCount %x\n",
ipcnum, ipcnum,
pDrvData->IPCs[ipcnum].usIntCount); pDrvData->IPCs[ipcnum].usIntCount);
if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) { if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"mwavedd::mwave_ioctl:" "mwavedd::mwave_ioctl:"
" IOCTL_MW_GET_IPC: Error:" " IOCTL_MW_GET_IPC: Error:"
...@@ -355,7 +355,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file, ...@@ -355,7 +355,7 @@ static int mwave_ioctl(struct inode *inode, struct file *file,
"mwavedd::mwave_ioctl IOCTL_MW_UNREGISTER_IPC" "mwavedd::mwave_ioctl IOCTL_MW_UNREGISTER_IPC"
" ipcnum %x\n", " ipcnum %x\n",
ipcnum); ipcnum);
if (ipcnum > ARRAY_SIZE(pDrvData->IPCs)) { if (ipcnum >= ARRAY_SIZE(pDrvData->IPCs)) {
PRINTK_ERROR(KERN_ERR_MWAVE PRINTK_ERROR(KERN_ERR_MWAVE
"mwavedd::mwave_ioctl:" "mwavedd::mwave_ioctl:"
" IOCTL_MW_UNREGISTER_IPC:" " IOCTL_MW_UNREGISTER_IPC:"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment