[ Upstream commit bbdf6cf56c ]

Although unlikely to be null, it is confusing to use a pointer
before checking for it to be null so move the use down after
null check.

Addresses-Coverity: 1517586 ("Null pointer dereferences  (REVERSE_INULL)")
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Steve French 2022-05-23 20:42:03 -05:00 коммит произвёл Greg Kroah-Hartman
Родитель df6d8b6892
Коммит 9e5b03ca02
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -745,8 +745,8 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
struct cifs_sb_info *cifs_sb,
struct cached_fid **cfid)
{
struct cifs_ses *ses = tcon->ses;
struct TCP_Server_Info *server = ses->server;
struct cifs_ses *ses;
struct TCP_Server_Info *server;
struct cifs_open_parms oparms;
struct smb2_create_rsp *o_rsp = NULL;
struct smb2_query_info_rsp *qi_rsp = NULL;
@ -764,6 +764,9 @@ int open_cached_dir(unsigned int xid, struct cifs_tcon *tcon,
if (tcon->nohandlecache)
return -ENOTSUPP;
ses = tcon->ses;
server = ses->server;
if (cifs_sb->root == NULL)
return -ENOENT;