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 @@ -402,8 +402,10 @@ sort_pacl(struct posix_acl *pacl)
402402 * by uid/gid. */
403403 int i , j ;
404404
405- if (pacl -> a_count <= 4 )
406- return ; /* no users or groups */
405+ /* no users or groups */
406+ if (!pacl || pacl -> a_count <= 4 )
407+ return ;
408+
407409 i = 1 ;
408410 while (pacl -> a_entries [i ].e_tag == ACL_USER )
409411 i ++ ;
@@ -530,13 +532,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
530532
531533 /*
532534 * ACLs with no ACEs are treated differently in the inheritable
533- * and effective cases: when there are no inheritable ACEs, we
534- * set a zero-length default posix acl:
535+ * and effective cases: when there are no inheritable ACEs,
536+ * calls ->set_acl with a NULL ACL structure.
535537 */
536- if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT )) {
537- pacl = posix_acl_alloc (0 , GFP_KERNEL );
538- return pacl ? pacl : ERR_PTR (- ENOMEM );
539- }
538+ if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT ))
539+ return NULL ;
540+
540541 /*
541542 * When there are no effective ACEs, the following will end
542543 * up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments