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 @@ -373,8 +373,10 @@ sort_pacl(struct posix_acl *pacl)
373373 * by uid/gid. */
374374 int i , j ;
375375
376- if (pacl -> a_count <= 4 )
377- return ; /* no users or groups */
376+ /* no users or groups */
377+ if (!pacl || pacl -> a_count <= 4 )
378+ return ;
379+
378380 i = 1 ;
379381 while (pacl -> a_entries [i ].e_tag == ACL_USER )
380382 i ++ ;
@@ -498,13 +500,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
498500
499501 /*
500502 * ACLs with no ACEs are treated differently in the inheritable
501- * and effective cases: when there are no inheritable ACEs, we
502- * set a zero-length default posix acl:
503+ * and effective cases: when there are no inheritable ACEs,
504+ * calls ->set_acl with a NULL ACL structure.
503505 */
504- if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT )) {
505- pacl = posix_acl_alloc (0 , GFP_KERNEL );
506- return pacl ? pacl : ERR_PTR (- ENOMEM );
507- }
506+ if (state -> empty && (flags & NFS4_ACL_TYPE_DEFAULT ))
507+ return NULL ;
508+
508509 /*
509510 * When there are no effective ACEs, the following will end
510511 * up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments