Patch "NFSv4.2: Fix READ_PLUS smatch warnings" has been added to the 6.4-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    NFSv4.2: Fix READ_PLUS smatch warnings

to the 6.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsv4.2-fix-read_plus-smatch-warnings.patch
and it can be found in the queue-6.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 889d59f19fb66d2a13338069fd2df847e3151512
Author: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
Date:   Wed May 24 17:27:08 2023 -0400

    NFSv4.2: Fix READ_PLUS smatch warnings
    
    [ Upstream commit bb05a617f06b7a882e19c4f475b8e37f14d9ceac ]
    
    Smatch reports:
      fs/nfs/nfs42xdr.c:1131 decode_read_plus() warn: missing error code? 'status'
    
    Which Dan suggests to fix by doing a hardcoded "return 0" from the
    "if (segments == 0)" check.
    
    Additionally, smatch reports that the "status = -EIO" assignment is not
    used. This patch addresses both these issues.
    
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Reported-by: Dan Carpenter <error27@xxxxxxxxx>
    Closes: https://lore.kernel.org/r/202305222209.6l5VM2lL-lkp@xxxxxxxxx/
    Fixes: d3b00a802c845 ("NFS: Replace the READ_PLUS decoding code")
    Signed-off-by: Anna Schumaker <Anna.Schumaker@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/nfs/nfs42xdr.c b/fs/nfs/nfs42xdr.c
index a6df815a140c7..ef3b150970ff6 100644
--- a/fs/nfs/nfs42xdr.c
+++ b/fs/nfs/nfs42xdr.c
@@ -1136,13 +1136,12 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
 	res->eof = be32_to_cpup(p++);
 	segments = be32_to_cpup(p++);
 	if (segments == 0)
-		return status;
+		return 0;
 
 	segs = kmalloc_array(segments, sizeof(*segs), GFP_KERNEL);
 	if (!segs)
 		return -ENOMEM;
 
-	status = -EIO;
 	for (i = 0; i < segments; i++) {
 		status = decode_read_plus_segment(xdr, &segs[i]);
 		if (status < 0)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux