Skip to content

Commit a9e17d3

Browse files
Paulo AlcantaraSteve French
authored andcommitted
cifs: fix static checker warning
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 <[email protected]> Signed-off-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent d717362 commit a9e17d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/smb2file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, __u32
123123

124124
if (unlikely(!err_iov.iov_base || err_buftype == CIFS_NO_BUFFER))
125125
rc = -ENOMEM;
126-
else if (hdr->Status == STATUS_STOPPED_ON_SYMLINK && oparms->cifs_sb) {
126+
else if (hdr->Status == STATUS_STOPPED_ON_SYMLINK) {
127127
rc = smb2_parse_symlink_response(oparms->cifs_sb, &err_iov,
128128
&data->symlink_target);
129129
if (!rc) {

0 commit comments

Comments
 (0)