Skip to content

Commit

Permalink
fs/devpts/inode.c: correctly check d_alloc_name() return code in devp…
Browse files Browse the repository at this point in the history
…ts_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]>
  • Loading branch information
avagin authored and torvalds committed Mar 23, 2011
1 parent e91f90b commit b12d125
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
mutex_lock(&root->d_inode->i_mutex);

dentry = d_alloc_name(root, s);
if (!IS_ERR(dentry)) {
if (dentry) {
d_add(dentry, inode);
fsnotify_create(root->d_inode, dentry);
} else {
Expand Down

0 comments on commit b12d125

Please sign in to comment.