1
0
Fork 0

oprofilefs: don't oops on allocation failure

... just short-circuit the creation of potential children

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
hifive-unleashed-5.1
Al Viro 2018-03-10 16:40:33 -05:00
parent 5bf1ddf7ee
commit a749896833
1 changed files with 3 additions and 0 deletions

View File

@ -138,6 +138,9 @@ static int __oprofilefs_create_file(struct dentry *root, char const *name,
struct dentry *dentry;
struct inode *inode;
if (!root)
return -ENOMEM;
inode_lock(d_inode(root));
dentry = d_alloc_name(root, name);
if (!dentry) {