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 @@ -402,8 +402,10 @@ sort_pacl(struct posix_acl *pacl)
402
402
* by uid/gid. */
403
403
int i , j ;
404
404
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
+
407
409
i = 1 ;
408
410
while (pacl -> a_entries [i ].e_tag == ACL_USER )
409
411
i ++ ;
@@ -530,13 +532,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
530
532
531
533
/*
532
534
* 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.
535
537
*/
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
+
540
541
/*
541
542
* When there are no effective ACEs, the following will end
542
543
* up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments