From: Dan Carpenter Date: Mon, 4 Apr 2022 20:06:28 +0000 (-0400) Subject: dlm: uninitialized variable on error in dlm_listen_for_all() X-Git-Tag: v5.15.73~3348 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=697b45d5f06a86ae95819c98a2e974f792d74409;p=platform%2Fkernel%2Flinux-rpi.git dlm: uninitialized variable on error in dlm_listen_for_all() commit 1f4f10845e14690b02410de50d9ea9684625a4ae upstream. 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 Signed-off-by: Alexander Aring Signed-off-by: David Teigland Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 7a8efce..b11f695 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -1776,7 +1776,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, check SCTP is loaded"); - goto out; + return result; } sock_set_mark(sock->sk, dlm_config.ci_mark);