--- open.c.0    Thu Jan 27 16:53:25 2000
+++ open.c      Fri Jan 28 07:38:30 2000
@@ -306,11 +306,12 @@
       struct dentry * dentry;
       int old_fsuid, old_fsgid;
       kernel_cap_t old_cap;
-       int res = -EINVAL;
+       int res;
+
+       if (mode & ~S_IRWXO)    /* where's F_OK, X_OK, W_OK, R_OK? */
+               return -EINVAL;

       lock_kernel();
-       if (mode != (mode & S_IRWXO))   /* where's F_OK, X_OK, W_OK, R_OK? */
-               goto out;
       old_fsuid = current->fsuid;
       old_fsgid = current->fsgid;
       old_cap = current->cap_effective;
@@ -337,7 +338,7 @@
       current->fsuid = old_fsuid;
       current->fsgid = old_fsgid;
       current->cap_effective = old_cap;
-out:
+
       unlock_kernel();
       return res;
}