X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Feventfd.c;h=343942deeec138b1925e7815d0ac819e41f1214e;hb=a8f43ee7e108cecf68cac652d0a3aeedb8131220;hp=a9f130cd50ac2be6009ed2091fce0ec21d134fdd;hpb=6e5565f949af1322f8f3d3f43d044645ae448499;p=karo-tx-linux.git diff --git a/fs/eventfd.c b/fs/eventfd.c index a9f130cd50ac..343942deeec1 100644 --- a/fs/eventfd.c +++ b/fs/eventfd.c @@ -200,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) @@ -216,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; }