summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@cjr.nz>2022-10-14 13:40:42 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-04 11:26:23 +0100
commit1c12816be53b52f90bc475aade24b3e9dc5c90f9 (patch)
tree7bd2a896c2f7543c52662c0fcc258fc5369c8e97
parent2a126e1db5553ce4498290df019866952f858954 (diff)
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@oracle.com> Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com> Stable-dep-of: f60ffa662d14 ("cifs: don't leak -ENOMEM in smb2_open_file()") Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--fs/cifs/smb2file.c2
1 files changed, 1 insertions, 1 deletions
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) {