diff options
Diffstat (limited to 'fs/f2fs/acl.c')
-rw-r--r-- | fs/f2fs/acl.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index 742202779bd5..4320ffab3495 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c | |||
@@ -351,13 +351,11 @@ static int f2fs_acl_create(struct inode *dir, umode_t *mode, | |||
351 | 351 | ||
352 | *acl = f2fs_acl_clone(p, GFP_NOFS); | 352 | *acl = f2fs_acl_clone(p, GFP_NOFS); |
353 | if (!*acl) | 353 | if (!*acl) |
354 | return -ENOMEM; | 354 | goto no_mem; |
355 | 355 | ||
356 | ret = f2fs_acl_create_masq(*acl, mode); | 356 | ret = f2fs_acl_create_masq(*acl, mode); |
357 | if (ret < 0) { | 357 | if (ret < 0) |
358 | posix_acl_release(*acl); | 358 | goto no_mem_clone; |
359 | return -ENOMEM; | ||
360 | } | ||
361 | 359 | ||
362 | if (ret == 0) { | 360 | if (ret == 0) { |
363 | posix_acl_release(*acl); | 361 | posix_acl_release(*acl); |
@@ -378,6 +376,12 @@ no_acl: | |||
378 | *default_acl = NULL; | 376 | *default_acl = NULL; |
379 | *acl = NULL; | 377 | *acl = NULL; |
380 | return 0; | 378 | return 0; |
379 | |||
380 | no_mem_clone: | ||
381 | posix_acl_release(*acl); | ||
382 | no_mem: | ||
383 | posix_acl_release(p); | ||
384 | return -ENOMEM; | ||
381 | } | 385 | } |
382 | 386 | ||
383 | int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, | 387 | int f2fs_init_acl(struct inode *inode, struct inode *dir, struct page *ipage, |