diff mbox series

smb: client: fix sparse warning in should_compress()

Message ID 20240918145904.750318-1-ematsumiya@suse.de (mailing list archive)
State New, archived
Headers show
Series smb: client: fix sparse warning in should_compress() | expand

Commit Message

Enzo Matsumiya Sept. 18, 2024, 2:59 p.m. UTC
Use le32_to_cpu() to read wreq->Length.

Signed-off-by: Enzo Matsumiya <ematsumiya@suse.de>
---
 fs/smb/client/compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/smb/client/compress.c b/fs/smb/client/compress.c
index baaa6a470f53..a9db6cddc219 100644
--- a/fs/smb/client/compress.c
+++ b/fs/smb/client/compress.c
@@ -306,7 +306,7 @@  bool should_compress(const struct cifs_tcon *tcon, const struct smb_rqst *rq)
 	if (shdr->Command == SMB2_WRITE) {
 		const struct smb2_write_req *wreq = rq->rq_iov->iov_base;
 
-		if (wreq->Length < SMB_COMPRESS_MIN_LEN)
+		if (le32_to_cpu(wreq->Length) < SMB_COMPRESS_MIN_LEN)
 			return false;
 
 		return is_compressible(&rq->rq_iter);