Skip to content

Commit

Permalink
eventfd: check ida_simple_get() return value
Browse files Browse the repository at this point in the history
As ida_simple_get() can fail, we should check the return value.

Signed-off-by: Bo Liu <liubo03@inspur.com>
  • Loading branch information
Bo Liu authored and intel-lab-lkp committed Sep 7, 2022
1 parent 0066f1b commit 04c5de6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/eventfd.c
Expand Up @@ -424,6 +424,8 @@ static int do_eventfd(unsigned int count, int flags)
ctx->count = count;
ctx->flags = flags;
ctx->id = ida_simple_get(&eventfd_ida, 0, 0, GFP_KERNEL);
if (ctx->id < 0)
goto err;

flags &= EFD_SHARED_FCNTL_FLAGS;
flags |= O_RDWR;
Expand Down

0 comments on commit 04c5de6

Please sign in to comment.