X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Feventfd.c;h=343942deeec138b1925e7815d0ac819e41f1214e;hb=8aca6cb1179ed9bef9351028c8d8af852903eae2;hp=2ce19c000d2adb40afc17205edcb937cbb84d730;hpb=5bc65793cbf8da0d35f19ef025dda22887e79e80;p=linux-2.6-omap-h63xx.git diff --git a/fs/eventfd.c b/fs/eventfd.c index 2ce19c000d2..343942deeec 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -15,6 +15,7 @@ #include #include #include +#include struct eventfd_ctx { wait_queue_head_t wqh; @@ -199,10 +200,8 @@ struct file *eventfd_fget(int fd) asmlinkage long sys_eventfd(unsigned int count) { - int error, fd; + int fd; struct eventfd_ctx *ctx; - struct file *file; - struct inode *inode; ctx = kmalloc(sizeof(*ctx), GFP_KERNEL); if (!ctx) @@ -215,12 +214,9 @@ asmlinkage long sys_eventfd(unsigned int count) * When we call this, the initialization must be complete, since * anon_inode_getfd() will install the fd. */ - error = anon_inode_getfd(&fd, &inode, &file, "[eventfd]", - &eventfd_fops, ctx); - if (!error) - return fd; - - kfree(ctx); - return error; + fd = anon_inode_getfd("[eventfd]", &eventfd_fops, ctx); + if (fd < 0) + kfree(ctx); + return fd; }