Skip to contentSkip to conversation

smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()

PATCH Applied [email protected] 2 participants 2 messages Dec 28, 2025 – Dec 29, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 smb/server: call ksmbd_session_rpc_close() on error path in create_smb2_pipe()

From: ZhangGuoDong <[email protected]>

When ksmbd_iov_pin_rsp() fails, we should call ksmbd_session_rpc_close().

---
 fs/smb/server/smb2pdu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
fs/smb/server/smb2pdu.c +4 -1
index 469b70757dba..571e9d5657c1 100644
@@ -2281,7 +2281,7 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
 {
 	struct smb2_create_rsp *rsp;
 	struct smb2_create_req *req;
-	int id;
+	int id = -1;
 	int err;
 	char *name;
 
@@ -2338,6 +2338,9 @@ static noinline int create_smb2_pipe(struct ksmbd_work *work)
 		break;
 	}
 
+	if (id >= 0)
+		ksmbd_session_rpc_close(work->sess, id);
+
 	if (!IS_ERR(name))
 		kfree(name);
 
Signature · 1 line
2.43.0