cifs: missing null check for newinode pointer

in cifs_do_create we check if newinode is valid before referencing it
but are missing the check in one place in fs/cifs/dir.c

Addresses-Coverity: 1357292 ("Dereference after null check")
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
Steve French 2021-06-22 19:53:08 -05:00
Родитель 4c4a525ae5
Коммит 0917310b98
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -384,6 +384,7 @@ cifs_create_set_dentry:
goto out_err; goto out_err;
} }
if (newinode)
if (S_ISDIR(newinode->i_mode)) { if (S_ISDIR(newinode->i_mode)) {
rc = -EISDIR; rc = -EISDIR;
goto out_err; goto out_err;