提交 b12d1259 编写于 作者: A Andrey Vagin 提交者: Linus Torvalds

fs/devpts/inode.c: correctly check d_alloc_name() return code in devpts_pty_new()

d_alloc_name return NULL in case error, but we expect errno in
devpts_pty_new.

Addresses http://bugzilla.openvz.org/show_bug.cgi?id=1758Signed-off-by: NAndrey Vagin <avagin@openvz.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 e91f90bb
...@@ -502,7 +502,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty) ...@@ -502,7 +502,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
mutex_lock(&root->d_inode->i_mutex); mutex_lock(&root->d_inode->i_mutex);
dentry = d_alloc_name(root, s); dentry = d_alloc_name(root, s);
if (!IS_ERR(dentry)) { if (dentry) {
d_add(dentry, inode); d_add(dentry, inode);
fsnotify_create(root->d_inode, dentry); fsnotify_create(root->d_inode, dentry);
} else { } else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册