From: Markus Elfring Date: Tue, 14 Apr 2015 22:42:59 +0000 (-0700) Subject: ocfs2: one function call less in user_cluster_connect() after error detection X-Git-Tag: firefly_0821_release~176^2~1984^2~111 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=43ee9cad8a81954eea893b52e08d0c00ca9baccc;p=firefly-linux-kernel-4.4.55.git 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 Cc: Mark Fasheh Cc: Joel Becker Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);