diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2018-03-10 16:40:33 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2018-03-29 15:07:48 -0400 |
commit | a7498968338da9b928f5d8054acc8be6ed2bc14c (patch) | |
tree | 393c9f7d6ef8fbf4fa3f71c8e90b3a8ef9a80e09 /drivers | |
parent | 5bf1ddf7ee0e23598a620ef9ea2b0f00e804859d (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/oprofile/oprofilefs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/oprofile/oprofilefs.c b/drivers/oprofile/oprofilefs.c index d77ebbfc67c9..4ea08979312c 100644 --- a/drivers/oprofile/oprofilefs.c +++ b/drivers/oprofile/oprofilefs.c | |||
@@ -138,6 +138,9 @@ static int __oprofilefs_create_file(struct dentry *root, char const *name, | |||
138 | struct dentry *dentry; | 138 | struct dentry *dentry; |
139 | struct inode *inode; | 139 | struct inode *inode; |
140 | 140 | ||
141 | if (!root) | ||
142 | return -ENOMEM; | ||
143 | |||
141 | inode_lock(d_inode(root)); | 144 | inode_lock(d_inode(root)); |
142 | dentry = d_alloc_name(root, name); | 145 | dentry = d_alloc_name(root, name); |
143 | if (!dentry) { | 146 | if (!dentry) { |