Skip to contentSkip to conversation

fs: dlm: fix missing unlock on error in accept_from_sock()

PATCH Applied Yang Yingliang 2 participants 2 messages Mar 27, 2021 – Mar 29, 2021 Distributed lock manager (DLM)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 fs/dlm/lowcomms.c | 1 +
 1 file changed, 1 insertion(+)
fs/dlm/lowcomms.c +1 -0
index 73cc1809050a..166e36fcf3e4 100644
@@ -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;
 			}
 
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 2 lines · Yang Yingliang

Add the missing unlock before return from accept_from_sock() in the error handling case.

Thanks, applied to the next branch.
Dave

Quoted 21 lines
Fixes 6cde210a9758 ("fs: dlm: add helper for init connection")
---
 fs/dlm/lowcomms.c | 1 +
 1 file changed, 1 insertion(+)
fs/dlm/lowcomms.c +1 -0
index 73cc1809050a..166e36fcf3e4 100644
@@ -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;
 			}
 
Signature · 1 line
2.25.1