Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43ee9cad authored by Markus Elfring's avatar Markus Elfring Committed by Linus Torvalds
Browse files

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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent bb34ed21
Loading
Loading
Loading
Loading
+2 −4
Original line number Original line Diff line number Diff line
@@ -1004,10 +1004,8 @@ static int user_cluster_connect(struct ocfs2_cluster_connection *conn)
	BUG_ON(conn == NULL);
	BUG_ON(conn == NULL);


	lc = kzalloc(sizeof(struct ocfs2_live_connection), GFP_KERNEL);
	lc = kzalloc(sizeof(struct ocfs2_live_connection), GFP_KERNEL);
	if (!lc) {
	if (!lc)
		rc = -ENOMEM;
		return -ENOMEM;
		goto out;
	}


	init_waitqueue_head(&lc->oc_wait);
	init_waitqueue_head(&lc->oc_wait);
	init_completion(&lc->oc_sync_wait);
	init_completion(&lc->oc_sync_wait);