Skip to content

Commit b12d125

Browse files
avagintorvalds
authored andcommitted
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=1758 Signed-off-by: Andrey Vagin <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent e91f90b commit b12d125

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/devpts/inode.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
502502
mutex_lock(&root->d_inode->i_mutex);
503503

504504
dentry = d_alloc_name(root, s);
505-
if (!IS_ERR(dentry)) {
505+
if (dentry) {
506506
d_add(dentry, inode);
507507
fsnotify_create(root->d_inode, dentry);
508508
} else {

0 commit comments

Comments
 (0)