]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] janitor: oss/ali copy*user fixes
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 6 Sep 2003 07:34:27 +0000 (00:34 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:34:27 +0000 (00:34 -0700)
From: Daniele Bellucci <bellucda@tiscali.it>

sound/oss/ali5455.c

index 7bb3d707d6c8af9f2ae145e78ca8c68d3733ba2f..a35ffba5e6d2f455e6de2f461e68541e855ea3e6 100644 (file)
@@ -2409,7 +2409,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
                printk("SNDCTL_DSP_GETOPTR %d, %d, %d, %d\n", cinfo.bytes,
                       cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-               return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
+               return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))? -EFAULT : 0;
        case SNDCTL_DSP_GETISPACE:
                if (!(file->f_mode & FMODE_READ))
                        return -EINVAL;
@@ -2448,7 +2448,7 @@ static int ali_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
                printk("SNDCTL_DSP_GETIPTR %d, %d, %d, %d\n", cinfo.bytes,
                       cinfo.blocks, cinfo.ptr, dmabuf->count);
 #endif
-               return copy_to_user((void *) arg, &cinfo, sizeof(cinfo));
+               return copy_to_user((void *) arg, &cinfo, sizeof(cinfo))? -EFAULT: 0;
        case SNDCTL_DSP_NONBLOCK:
 #ifdef DEBUG
                printk("SNDCTL_DSP_NONBLOCK\n");