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>
This commit is contained in:
Steve French 2022-05-25 23:56:07 -05:00
parent de3a9e943d
commit 44a48081fc
2 changed files with 3 additions and 4 deletions

View file

@ -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:
/*

View file

@ -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,