File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -385,8 +385,10 @@ sort_pacl(struct posix_acl *pacl)
385385 * by uid/gid. */
386386 int i , j ;
387387
388- if (pacl -> a_count <= 4 )
389- return ; /* no users or groups */
388+ /* no users or groups */
389+ if (!pacl || pacl -> a_count <= 4 )
390+ return ;
391+
390392 i = 1 ;
391393 while (pacl -> a_entries [i ].e_tag == ACL_USER )
392394 i ++ ;
@@ -513,13 +515,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
513515
514516 /*
515517 * ACLs with no ACEs are treated differently in the inheritable
516- * and effective cases: when there are no inheritable ACEs, we
517- * set a zero-length default posix acl:
518+ * and effective cases: when there are no inheritable ACEs,
519+ * calls ->set_acl with a NULL ACL structure.
518520 */
519- if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT )) {
520- pacl = posix_acl_alloc (0 , GFP_KERNEL );
521- return pacl ? pacl : ERR_PTR (- ENOMEM );
522- }
521+ if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT ))
522+ return NULL ;
523+
523524 /*
524525 * When there are no effective ACEs, the following will end
525526 * up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments