From: Yang Yingliang Date: Sat, 27 Mar 2021 08:37:04 +0000 (+0800) Subject: fs: dlm: fix missing unlock on error in accept_from_sock() X-Git-Tag: v5.11.21~178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9892d12ac1ab92e58e1de3fe1de95dd6e999bcbb;p=thirdparty%2Fkernel%2Fstable.git fs: dlm: fix missing unlock on error in accept_from_sock() [ 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 Signed-off-by: Yang Yingliang Signed-off-by: David Teigland Signed-off-by: Sasha Levin --- diff --git a/fs/dlm/lowcomms.c b/fs/dlm/lowcomms.c index 372c34ff8594f..f7d2c52791f8f 100644 --- a/fs/dlm/lowcomms.c +++ b/fs/dlm/lowcomms.c @@ -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; }