Commit 43c7f68f authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: oss/forte copy*user fixes

This patch catches insures proper return values from
copy_to/from_user calls.

From: Ron Gage <ron@rongage.org>
parent d88607df
......@@ -1066,7 +1066,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq (&chip->lock);
return copy_to_user ((void *) arg, &abi, sizeof (abi));
return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
case SNDCTL_DSP_GETIPTR:
DPRINTK ("%s: GETIPTR\n", __FUNCTION__);
......@@ -1087,7 +1087,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq (&chip->lock);
return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo));
return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
case SNDCTL_DSP_GETOSPACE:
if (!wr)
......@@ -1115,7 +1115,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq (&chip->lock);
return copy_to_user ((void *) arg, &abi, sizeof (abi));
return copy_to_user ((void *) arg, &abi, sizeof (abi)) ? -EFAULT : 0;
case SNDCTL_DSP_GETOPTR:
if (!wr)
......@@ -1134,7 +1134,7 @@ forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd,
spin_unlock_irq (&chip->lock);
return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo));
return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)) ? -EFAULT : 0;
case SNDCTL_DSP_GETODELAY:
if (!wr)
......
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