mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
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:
parent
4c4a525ae5
commit
0917310b98
@ -384,10 +384,11 @@ cifs_create_set_dentry:
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
if (S_ISDIR(newinode->i_mode)) {
|
||||
rc = -EISDIR;
|
||||
goto out_err;
|
||||
}
|
||||
if (newinode)
|
||||
if (S_ISDIR(newinode->i_mode)) {
|
||||
rc = -EISDIR;
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
d_drop(direntry);
|
||||
d_add(direntry, newinode);
|
||||
|
Loading…
Reference in New Issue
Block a user