File tree 1 file changed +9
-8
lines changed
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)
385
385
* by uid/gid. */
386
386
int i , j ;
387
387
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
+
390
392
i = 1 ;
391
393
while (pacl -> a_entries [i ].e_tag == ACL_USER )
392
394
i ++ ;
@@ -513,13 +515,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
513
515
514
516
/*
515
517
* 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.
518
520
*/
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
+
523
524
/*
524
525
* When there are no effective ACEs, the following will end
525
526
* up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments