summaryrefslogtreecommitdiffstats
path: root/fs/ocfs2
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-04-15 00:42:59 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 01:48:57 +0200
commit43ee9cad8a81954eea893b52e08d0c00ca9baccc (patch)
tree6209cc6ac2d8ba05e7079c9977434519c9495108 /fs/ocfs2
parentocfs2: one function call less in ocfs2_init_slot_info() after error detection (diff)
downloadlinux-43ee9cad8a81954eea893b52e08d0c00ca9baccc.tar.xz
linux-43ee9cad8a81954eea893b52e08d0c00ca9baccc.zip
ocfs2: one function call less in user_cluster_connect() after error detection
kfree() was called by user_cluster_connect() even if a previous call of the kzalloc() function failed. Return from this implementation directly after failure detection. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <jlbec@evilplan.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r--fs/ocfs2/stack_user.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c
index c3b7807c65d6..2768eb1da2b8 100644
--- a/fs/ocfs2/stack_user.c
+++ b/fs/ocfs2/stack_user.c
@@ -1004,10 +1004,8 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn)
BUG_ON(conn == NULL);
lc = kzalloc(sizeof(struct ocfs2_live_connection), GFP_KERNEL);
- if (!lc) {
- rc = -ENOMEM;
- goto out;
- }
+ if (!lc)
+ return -ENOMEM;
init_waitqueue_head(&lc->oc_wait);
init_completion(&lc->oc_sync_wait);