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>
        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);