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 @@ -373,8 +373,10 @@ sort_pacl(struct posix_acl *pacl)
373
373
* by uid/gid. */
374
374
int i , j ;
375
375
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
+
378
380
i = 1 ;
379
381
while (pacl -> a_entries [i ].e_tag == ACL_USER )
380
382
i ++ ;
@@ -498,13 +500,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
498
500
499
501
/*
500
502
* 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.
503
505
*/
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
+
508
509
/*
509
510
* When there are no effective ACEs, the following will end
510
511
* up setting a 3-element effective posix ACL with all
You can’t perform that action at this time.
0 commit comments