Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.25-git20 /fs/signalfd.c

Filename:/fs/signalfd.c
Lines Added:4
Lines Deleted:13
Also changed in: (Previous) 2.6.25-git19  2.6.25  2.6.25-rc9  2.6.25-rc8-git10  2.6.25-rc8  2.6.25-rc7 
(Following) 2.6.26-rc1  2.6.26-rc2  2.6.26-rc3  2.6.26-rc4  2.6.26-rc5  2.6.26-rc6 

Location
[  2.6.25-git20
  [  fs
     o  signalfd.c

Patch

diff --git a/fs/signalfd.c b/fs/signalfd.c
index 8ead0db..6197256 100644
--- a/fs/signalfd.c
+++ b/fs/signalfd.c
@@ -207,11 +207,8 @@ static const struct file_operations signalfd_fops = {
 
 asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemask)
 {
-   int error;
    sigset_t sigmask;
    struct signalfd_ctx *ctx;
-   struct file *file;
-   struct inode *inode;
 
    if (sizemask != sizeof(sigset_t) ||
        copy_from_user(&sigmask, user_mask, sizeof(sigmask)))
@@ -230,12 +227,11 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
        * When we call this, the initialization must be complete, since
        * anon_inode_getfd() will install the fd.
        */
-      error = anon_inode_getfd(&ufd, &inode, &file, "[signalfd]",
-                &signalfd_fops, ctx);
-      if (error)
-         goto err_fdalloc;
+      ufd = anon_inode_getfd("[signalfd]", &signalfd_fops, ctx);
+      if (ufd < 0)
+         kfree(ctx);
    } else {
-      file = fget(ufd);
+      struct file *file = fget(ufd);
       if (!file)
          return -EBADF;
       ctx = file->private_data;
@@ -252,9 +248,4 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
    }
 
    return ufd;
-
-err_fdalloc:
-   kfree(ctx);
-   return error;
 }
-


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.