Skip to content

Commit

Permalink
oprofilefs: don't oops on allocation failure
Browse files Browse the repository at this point in the history
... just short-circuit the creation of potential children

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Mar 29, 2018
1 parent 5bf1ddf commit a749896
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/oprofile/oprofilefs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a749896

Please sign in to comment.