Skip to content

Commit

Permalink
eventfd_ctx_fdget(): use fdget() instead of fget()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Jan 25, 2014
1 parent 1c1c874 commit 36a7411
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions fs/eventfd.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,12 @@ EXPORT_SYMBOL_GPL(eventfd_fget);
*/
struct eventfd_ctx *eventfd_ctx_fdget(int fd)
{
struct file *file;
struct eventfd_ctx *ctx;

file = eventfd_fget(fd);
if (IS_ERR(file))
return (struct eventfd_ctx *) file;
ctx = eventfd_ctx_get(file->private_data);
fput(file);

struct fd f = fdget(fd);
if (!f.file)
return ERR_PTR(-EBADF);
ctx = eventfd_ctx_fileget(f.file);
fdput(f);
return ctx;
}
EXPORT_SYMBOL_GPL(eventfd_ctx_fdget);
Expand Down

0 comments on commit 36a7411

Please sign in to comment.