]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] janitor: fix oss/swarm copy*user
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 6 Sep 2003 07:35:50 +0000 (00:35 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:35:50 +0000 (00:35 -0700)
This patch catches insures proper return values from
copy_to/from_user calls.

From: Ron Gage <ron@rongage.org>

sound/oss/swarm_cs4297a.c

index 8c3f93c42da873a02f844811c974935d9cb36b44..d778b94b59622677f74b628bb59415535d5f8e96 100644 (file)
@@ -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) {