Commit 673ea6e3 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

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

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

From: Ron Gage <ron@rongage.org>
parent 1162484f
......@@ -1655,7 +1655,7 @@ static int it8172_ioctl(struct inode *inode, struct file *file,
if (count < 0)
count = 0;
cinfo.blocks = count >> s->dma_adc.fragshift;
return copy_to_user((void *)arg, &cinfo, sizeof(cinfo));
return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
case SNDCTL_DSP_GETOPTR:
if (!(file->f_mode & FMODE_READ))
......@@ -1678,7 +1678,7 @@ static int it8172_ioctl(struct inode *inode, struct file *file,
if (count < 0)
count = 0;
cinfo.blocks = count >> s->dma_dac.fragshift;
return copy_to_user((void *)arg, &cinfo, sizeof(cinfo));
return copy_to_user((void *)arg, &cinfo, sizeof(cinfo)) ? -EFAULT : 0;
case SNDCTL_DSP_GETBLKSIZE:
if (file->f_mode & FMODE_WRITE)
......
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