dlm: uninitialized variable on error in dlm_listen_for_all()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 4 Apr 2022 20:06:28 +0000 (16:06 -0400)
committerDavid Teigland <teigland@redhat.com>
Wed, 6 Apr 2022 19:01:44 +0000 (14:01 -0500)
The "sock" variable is not initialized on this error path.

Cc: stable@vger.kernel.org
Fixes: 2dc6b1158c28 ("fs: dlm: introduce generic listen")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/lowcomms.c

index e284d69..6ed935a 100644 (file)
@@ -1789,7 +1789,7 @@ static int dlm_listen_for_all(void)
                                  SOCK_STREAM, dlm_proto_ops->proto, &sock);
        if (result < 0) {
                log_print("Can't create comms socket: %d", result);
-               goto out;
+               return result;
        }
 
        sock_set_mark(sock->sk, dlm_config.ci_mark);