Commit 065fdbc4 authored by Randy Dunlap's avatar Randy Dunlap Committed by Linus Torvalds

[PATCH] janitor: fix oss/swarm copy*user

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

From: Ron Gage <ron@rongage.org>
parent a0186912
......@@ -2257,7 +2257,7 @@ static int cs4297a_ioctl(struct inode *inode, struct file *file,
if (s->dma_adc.mapped)
s->dma_adc.count &= s->dma_adc.fragsize - 1;
spin_unlock_irqrestore(&s->lock, flags);
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_WRITE))
......@@ -2281,7 +2281,7 @@ static int cs4297a_ioctl(struct inode *inode, struct file *file,
if (s->dma_dac.mapped)
s->dma_dac.count &= s->dma_dac.fragsize - 1;
spin_unlock_irqrestore(&s->lock, flags);
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