Merge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
[powerpc.git] / fs / compat_ioctl.c
index 6972d24..65643de 100644 (file)
@@ -684,8 +684,10 @@ static int hdio_getgeo(unsigned int fd, unsigned int cmd, unsigned long arg)
        if (!err) {
                err = copy_to_user (ugeo, &geo, 4);
                err |= __put_user (geo.start, &ugeo->start);
+               if (err)
+                       err = -EFAULT;
        }
-       return err ? -EFAULT : 0;
+       return err;
 }
 
 static int hdio_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
@@ -3564,10 +3566,13 @@ asmlinkage long compat_sys_ioctl(unsigned int fd, unsigned int cmd,
                        goto found_handler;
        }
 
+#ifdef CONFIG_NET
        if (S_ISSOCK(filp->f_path.dentry->d_inode->i_mode) &&
            cmd >= SIOCDEVPRIVATE && cmd <= (SIOCDEVPRIVATE + 15)) {
                error = siocdevprivate_ioctl(fd, cmd, arg);
-       } else {
+       } else
+#endif
+       {
                static int count;
 
                if (++count <= 50)