Kaynağa Gözat

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>
Al Viro 7 yıl önce
ebeveyn
işleme
a749896833
1 değiştirilmiş dosya ile 3 ekleme ve 0 silme
  1. 3 0
      drivers/oprofile/oprofilefs.c

+ 3 - 0
drivers/oprofile/oprofilefs.c

@@ -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) {