]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs: dlm: fix missing unlock on error in accept_from_sock()
authorYang Yingliang <yangyingliang@huawei.com>
Sat, 27 Mar 2021 08:37:04 +0000 (16:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:02 +0000 (10:50 +0200)
[ Upstream commit 2fd8db2dd05d895961c7c7b9fa02d72f385560e4 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/dlm/lowcomms.c

index 372c34ff8594fc1f280811d9cbd06e0ffab97178..f7d2c52791f8f262d72c95fc105e37fafa7aad87 100644 (file)
@@ -908,6 +908,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;
                        }