From: "Tiezhu Yang" <kernelpatch@126.com>
To: jaegeuk@kernel.org
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH] f2fs: avoid unnecessary function call
Date: Sat, 1 Jul 2017 07:02:54 +0800 (CST) [thread overview]
Message-ID: <22a88618.4a1.15cfb3e2aeb.Coremail.kernelpatch@126.com> (raw)
It should call the function fscrypt_fname_free_buffer() in the exception
handling only after the function fscrypt_fname_alloc_buffer() returns 0,
otherwise it is unnecessary.
Signed-off-by: Tiezhu Yang <kernelpatch@126.com>
---
fs/f2fs/namei.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index c31b40e..3225a82 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -1036,12 +1036,12 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
res = fscrypt_fname_disk_to_usr(inode, 0, 0, &cstr, &pstr);
if (res)
- goto errout;
+ goto out;
/* this is broken symlink case */
if (unlikely(pstr.name[0] == 0)) {
res = -ENOENT;
- goto errout;
+ goto out;
}
paddr = pstr.name;
@@ -1052,8 +1052,9 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
put_page(cpage);
set_delayed_call(done, kfree_link, paddr);
return paddr;
-errout:
+out:
fscrypt_fname_free_buffer(&pstr);
+errout:
put_page(cpage);
return ERR_PTR(res);
}
--
1.8.3.1
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next reply other threads:[~2017-06-30 23:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 23:02 Tiezhu Yang [this message]
2017-07-01 7:39 ` [PATCH] f2fs: avoid unnecessary function call Jaegeuk Kim
2017-07-02 16:04 ` Tiezhu Yang
2017-07-05 2:25 ` Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22a88618.4a1.15cfb3e2aeb.Coremail.kernelpatch@126.com \
--to=kernelpatch@126.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.