fs: Correctly check d_alloc_name() return code in devpts_pty_new
PATCH 1/1 fs: 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.
http://bugzilla.openvz.org/show_bug.cgi?id=1758
Signed-off-by Andrey Vagin <[email protected]>
--- fs/devpts/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/devpts/inode.c +1 -1
@@ -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); }
Signature · 1 line
1.7.2.1
Sorry, I found one more similar place, so will send another patch.
Quoted 23 lines · Andrey Vagin
d_alloc_namereturn NULL in case error, but we expect errno indevpts_pty_new.http://bugzilla.openvz.org/show_bug.cgi?id=1758
Signed-off-by Andrey Vagin<[email protected]>--- fs/devpts/inode.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)fs/devpts/inode.c +1
-1@@ -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); }