summaryrefslogtreecommitdiffstats
path: root/fs/dlm
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2022-10-27 16:45:11 -0400
committerDavid Teigland <teigland@redhat.com>2022-11-08 12:59:41 -0600
commit08ae0547e75ec3d062b6b6b9cf4830c730df68df (patch)
tree491f1ede4c9ed6c9bd466413bcd073b84d6d58ee /fs/dlm
parentd96d0f9617793b6cd95b9b9a8fef66f69f8f6b1b (diff)
downloadlinux-08ae0547e75ec3d062b6b6b9cf4830c730df68df.tar.gz
linux-08ae0547e75ec3d062b6b6b9cf4830c730df68df.tar.bz2
linux-08ae0547e75ec3d062b6b6b9cf4830c730df68df.zip
fs: dlm: fix sock release if listen fails
This patch fixes a double sock_release() call when the listen() is called for the dlm lowcomms listen socket. The caller of dlm_listen_for_all should never care about releasing the socket if dlm_listen_for_all() fails, it's done now only once if listen() fails. Cc: stable@vger.kernel.org Fixes: 2dc6b1158c28 ("fs: dlm: introduce generic listen") Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
Diffstat (limited to 'fs/dlm')
-rw-r--r--fs/dlm/lowcomms.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 59f64c596233..2cb9f3b49e05 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -1820,7 +1820,7 @@ static int dlm_listen_for_all(void)
result = sock->ops->listen(sock, 5);
if (result < 0) {
dlm_close_sock(&listen_con.sock);
- goto out;
+ return result;
}
return 0;
@@ -2023,7 +2023,6 @@ fail_listen:
dlm_proto_ops = NULL;
fail_proto_ops:
dlm_allow_conn = 0;
- dlm_close_sock(&listen_con.sock);
work_stop();
fail_local:
deinit_local();