Skip to contentSkip to conversation

cifsd: Fix an error code in smb2_read()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 22, 2021 – Mar 23, 2021

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

PATCH 1/1 cifsd: Fix an error code in smb2_read()

This code is assigning the wrong variable to "err" so it returns zero/success instead of -ENOMEM.

Fixes 788b6f45c1d2 ("cifsd: add server-side procedures for SMB3")
---
 fs/cifsd/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifsd/smb2pdu.c +1 -1
index 32816baa8a99..6770ebedc24a 100644
@@ -6200,7 +6200,7 @@ int smb2_read(struct ksmbd_work *work)
 		work->aux_payload_buf = ksmbd_alloc_response(length);
 	}
 	if (!work->aux_payload_buf) {
-		err = nbytes;
+		err = -ENOMEM;
 		goto out;
 	}
 
Signature · 1 line
2.30.2
#1 lore raw

Hi Dan,

Quoted 4 lines

This code is assigning the wrong variable to "err" so it returns zero/success instead of -ENOMEM.

Fixes 788b6f45c1d2 ("cifsd: add server-side procedures for SMB3")

I will apply this patch.
Thanks for your work!

Quoted 18 lines
---
 fs/cifsd/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifsd/smb2pdu.c +1 -2
@@ -6200,7 +6200,7 @@ int smb2_read(struct ksmbd_work *work)
 		work->aux_payload_buf = ksmbd_alloc_response(length);
 	}
 	if (!work->aux_payload_buf) {
-		err = nbytes;
+		err = -ENOMEM;
 		goto out;
 	}
 
--

2.30.2