diff mbox series

[1/3] ksmbd: fix endless loop when encryption for response fails

Message ID 20220922143906.10826-1-linkinjeon@kernel.org
State New
Headers show
Series [1/3] ksmbd: fix endless loop when encryption for response fails | expand

Commit Message

Namjae Jeon Sept. 22, 2022, 2:39 p.m. UTC
If ->encrypt_resp return error, goto statement cause endless loop.
It send an error response immediately after removing it.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
 fs/ksmbd/server.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/fs/ksmbd/server.c b/fs/ksmbd/server.c
index ce42bff42ef9..a0d635304754 100644
--- a/fs/ksmbd/server.c
+++ b/fs/ksmbd/server.c
@@ -235,10 +235,8 @@  static void __handle_ksmbd_work(struct ksmbd_work *work,
 	if (work->sess && work->sess->enc && work->encrypted &&
 	    conn->ops->encrypt_resp) {
 		rc = conn->ops->encrypt_resp(work);
-		if (rc < 0) {
+		if (rc < 0)
 			conn->ops->set_rsp_status(work, STATUS_DATA_ERROR);
-			goto send;
-		}
 	}
 
 	ksmbd_conn_write(work);