From: Daeseok Youn <daeseok.youn@gmail.com>
To: mfasheh@suse.com, akpm@linux-foundation.org
Cc: jlbec@evilplan.org, ocfs2-devel@oss.oracle.com,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] ocfs2: remove unneeded 'rc' for kfree()
Date: Tue, 17 Feb 2015 16:14:24 +0900 [thread overview]
Message-ID: <20150217071424.GA9582@devel.8.8.4.4> (raw)
If kzalloc() is failed, just goto 'out' label and
'out_free' label doesn't need to check 'rc' variable.
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
fs/ocfs2/stack_o2cb.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c
index 813d726..46ab104 100644
--- a/fs/ocfs2/stack_o2cb.c
+++ b/fs/ocfs2/stack_o2cb.c
@@ -347,7 +347,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn)
priv = kzalloc(sizeof(struct o2dlm_private), GFP_KERNEL);
if (!priv) {
rc = -ENOMEM;
- goto out_free;
+ goto out;
}
/* This just fills the structure in. It is safe to pass conn. */
@@ -376,8 +376,7 @@ static int o2cb_cluster_connect(struct ocfs2_cluster_connection *conn)
dlm_register_eviction_cb(dlm, &priv->op_eviction_cb);
out_free:
- if (rc)
- kfree(conn->cc_private);
+ kfree(conn->cc_private);
out:
return rc;
--
1.7.1
reply other threads:[~2015-02-17 7:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20150217071424.GA9582@devel.8.8.4.4 \
--to=daeseok.youn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®