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)
committerDavid Teigland <teigland@redhat.com>
Mon, 29 Mar 2021 18:28:18 +0000 (13:28 -0500)
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>
fs/dlm/lowcomms.c

index 73cc1809050a5f2b513d4f7dd4b369fe0e71a8ee..166e36fcf3e4c16867821dd11c6c6df2c9440bd9 100644 (file)
@@ -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;
                        }