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

From: Ron Gage <ron@rongage.org>

sound/oss/ite8172.c

index b759a46808aff49ab3da51ee2e05bbae3c2de542..1e3ae3a3909afb833bd9525eb33a9d3490b65c05 100644 (file)
@@ -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)