summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2021-03-27 09:37:04 +0100
committerDavid Teigland <teigland@redhat.com>2021-03-29 20:28:18 +0200
commit2fd8db2dd05d895961c7c7b9fa02d72f385560e4 (patch)
tree40cbbfaf8fd8cbb9303159abac4d3d74defb2923
parentfs: dlm: add shutdown hook (diff)
downloadlinux-2fd8db2dd05d895961c7c7b9fa02d72f385560e4.tar.xz
linux-2fd8db2dd05d895961c7c7b9fa02d72f385560e4.zip
fs: dlm: fix missing unlock on error in accept_from_sock()
Add the missing unlock before return from accept_from_sock() in the error handling case. Fixes: 6cde210a9758 ("fs: dlm: add helper for init connection") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r--fs/dlm/lowcomms.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c
index 73cc1809050a..166e36fcf3e4 100644
--- a/fs/dlm/lowcomms.c
+++ b/fs/dlm/lowcomms.c
@@ -931,6 +931,7 @@ static int accept_from_sock(struct listen_connection *con)
result = dlm_con_init(othercon, nodeid);
if (result < 0) {
kfree(othercon);
+ mutex_unlock(&newcon->sock_mutex);
goto accept_err;
}