diff options
author | Steve French <stfrench@microsoft.com> | 2022-05-25 23:56:07 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2022-05-27 12:05:47 -0500 |
commit | 44a48081fc03187d3c047077f3ad3eb3a3eaf8fb (patch) | |
tree | a93dfc795d63a44b41af30102ed10f5e6bc32177 /fs | |
parent | de3a9e943ddecba8d2ac1dde4cfff538e5c6a7b9 (diff) | |
download | linux-44a48081fc03187d3c047077f3ad3eb3a3eaf8fb.tar.bz2 |
smb3: remove unneeded null check in cifs_readdir
Coverity pointed out an unneeded check.
Addresses-Coverity: 1518030 ("Null pointer dereferences")
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/readdir.c | 6 | ||||
-rw-r--r-- | fs/cifs/smb2ops.c | 1 |
2 files changed, 3 insertions, 4 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index ccf34481d801..384cabdf47ca 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c @@ -1105,10 +1105,8 @@ int cifs_readdir(struct file *file, struct dir_context *ctx) * find_cifs_entry in case there will be reconnects during * query_directory. */ - if (cfid) { - close_cached_dir(cfid); - cfid = NULL; - } + close_cached_dir(cfid); + cfid = NULL; cache_not_found: /* diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 7e2c86e0cede..d7ade739cde1 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -770,6 +770,7 @@ smb2_cached_lease_break(struct work_struct *work) /* * Open the and cache a directory handle. * Only supported for the root handle. + * If error then *cfid is not initialized. */ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon, const char *path, |