[PATCH] smb: client: fix sparse warning in should_compress()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use le32_to_cpu() to read wreq->Length.

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

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);
-- 
2.46.0





[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux