From: Andrey Vagin Date: Tue, 22 Mar 2011 23:35:11 +0000 (-0700) Subject: fs/devpts/inode.c: correctly check d_alloc_name() return code in devpts_pty_new() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b12d12596992f608f5506a8dabe4d1299594bd1e;p=openwrt%2Fstaging%2Fblogic.git 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index c6bd815dc794..2f27e578d466 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -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 {