From: Steve French Date: Thu, 26 May 2022 04:56:07 +0000 (-0500) Subject: smb3: remove unneeded null check in cifs_readdir X-Git-Tag: baikal/aarch64/sdk6.1~3888^2 X-Git-Url: https://git.baikalelectronics.ru/sdk/?a=commitdiff_plain;h=45ccbfc2ab8ce2c3ae41595eeba8c5904b870735;p=kernel.git smb3: remove unneeded null check in cifs_readdir Coverity pointed out an unneeded check. Addresses-Coverity: 1518030 ("Null pointer dereferences") Reviewed-by: Ronnie Sahlberg Signed-off-by: Steve French --- diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index ccf34481d8012..384cabdf47caa 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 7e2c86e0cede8..d7ade739cde19 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,