lkml.org 
[lkml]   [2011]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] fs: Correctly check d_find_alias() return code in devpts_pty_kill
Date
d_find_alias() return NULL in case error, but we expected errno in
devpts_pty_kill.

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

diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 8392c8c..530b1f1 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -544,14 +544,12 @@ void devpts_pty_kill(struct tty_struct *tty)
mutex_lock(&root->d_inode->i_mutex);

dentry = d_find_alias(inode);
- if (IS_ERR(dentry))
+ if (!dentry)
goto out;

- if (dentry) {
- inode->i_nlink--;
- d_delete(dentry);
- dput(dentry); /* d_alloc_name() in devpts_pty_new() */
- }
+ inode->i_nlink--;
+ d_delete(dentry);
+ dput(dentry); /* d_alloc_name() in devpts_pty_new() */

dput(dentry); /* d_find_alias above */
out:
--
1.7.2.1


\
 
 \ /
  Last update: 2011-02-04 16:31    [W:0.039 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site