Skip to content

Commit 44a4808

Browse files
committed
smb3: remove unneeded null check in cifs_readdir
Coverity pointed out an unneeded check. Addresses-Coverity: 1518030 ("Null pointer dereferences") Reviewed-by: Ronnie Sahlberg <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent de3a9e9 commit 44a4808

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

fs/cifs/readdir.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,10 +1105,8 @@ int cifs_readdir(struct file *file, struct dir_context *ctx)
11051105
* find_cifs_entry in case there will be reconnects during
11061106
* query_directory.
11071107
*/
1108-
if (cfid) {
1109-
close_cached_dir(cfid);
1110-
cfid = NULL;
1111-
}
1108+
close_cached_dir(cfid);
1109+
cfid = NULL;
11121110

11131111
cache_not_found:
11141112
/*

fs/cifs/smb2ops.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,7 @@ smb2_cached_lease_break(struct work_struct *work)
770770
/*
771771
* Open the and cache a directory handle.
772772
* Only supported for the root handle.
773+
* If error then *cfid is not initialized.
773774
*/
774775
int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
775776
const char *path,

0 commit comments

Comments
 (0)