This is a note to let you know that I've just added the patch titled cifs: fix static checker warning to the 6.0-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: cifs-fix-static-checker-warning.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 810eccbce5f5281d5666052aa44f22ef00f0ece5 Author: Paulo Alcantara <pc@xxxxxx> Date: Fri Oct 14 13:40:42 2022 -0300 cifs: fix static checker warning [ Upstream commit a9e17d3d74d14e5fd10d54f0a07e0fce4e5f80dd ] Remove unnecessary NULL check of oparam->cifs_sb when parsing symlink error response as it's already set by all smb2_open_file() callers and deferenced earlier. This fixes below report: fs/cifs/smb2file.c:126 smb2_open_file() warn: variable dereferenced before check 'oparms->cifs_sb' (see line 112) Link: https://lore.kernel.org/r/Y0kt42j2tdpYakRu@kili Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx> Signed-off-by: Paulo Alcantara (SUSE) <pc@xxxxxx> Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx> Stable-dep-of: f60ffa662d14 ("cifs: don't leak -ENOMEM in smb2_open_file()") Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index 4992b43616a7..ffbd9a99fc12 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c @@ -123,7 +123,7 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, __u32 if (unlikely(!err_iov.iov_base || err_buftype == CIFS_NO_BUFFER)) rc = -ENOMEM; - else if (hdr->Status == STATUS_STOPPED_ON_SYMLINK && oparms->cifs_sb) { + else if (hdr->Status == STATUS_STOPPED_ON_SYMLINK) { rc = smb2_parse_symlink_response(oparms->cifs_sb, &err_iov, &data->symlink_target); if (!rc) {