LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] fs: Correctly check d_alloc_name() return code in devpts_pty_new
@ 2011-02-03 11:29 Andrey Vagin
  2011-02-03 15:56 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Vagin @ 2011-02-03 11:29 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Andrey Vagin

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

http://bugzilla.openvz.org/show_bug.cgi?id=1758

Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/devpts/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 1bb547c..8392c8c 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -501,7 +501,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);
 	}
-- 
1.7.2.1


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] fs: Correctly check d_alloc_name() return code in devpts_pty_new
@ 2011-02-03 16:07 Andrey Vagin
  2011-02-03 19:46 ` avagin
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Vagin @ 2011-02-03 16:07 UTC (permalink / raw)
  To: Al Viro; +Cc: Tejun Heo, Andrew Morton, linux-kernel, Andrey Vagin

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

http://bugzilla.openvz.org/show_bug.cgi?id=1758

Signed-off-by: Andrey Vagin <avagin@openvz.org>
---
 fs/devpts/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 1bb547c..8392c8c 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -501,7 +501,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);
 	}
-- 
1.7.2.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-03 19:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-03 11:29 [PATCH] fs: Correctly check d_alloc_name() return code in devpts_pty_new Andrey Vagin
2011-02-03 15:56 ` Greg KH
2011-02-03 16:07 Andrey Vagin
2011-02-03 19:46 ` avagin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).