Commit 0917310b authored by Steve French's avatar Steve French
Browse files

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: default avatarSachin Prabhu <sprabhu@redhat.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 4c4a525a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -384,6 +384,7 @@ cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
		goto out_err;
	}

	if (newinode)
		if (S_ISDIR(newinode->i_mode)) {
			rc = -EISDIR;
			goto out_err;