]> git.hungrycats.org Git - linux/commitdiff
[PATCH] janitor: oss/au1000 copy*user fixes
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 6 Sep 2003 07:36:15 +0000 (00:36 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:36:15 +0000 (00:36 -0700)
This patch catches insures proper return values from
copy_to/from_user calls.

From: Ron Gage <ron@rongage.org>

sound/oss/au1000.c

index dc6f8aa741482408afdde86415fdc28c9d1674b6..d1bf459b0833e041b9bcf334783ddf25ccb88d45 100644 (file)
@@ -1728,7 +1728,7 @@ static int au1000_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))
@@ -1751,7 +1751,7 @@ static int au1000_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)