Skip to content

Commit 46b5e18

Browse files
author
Al Viro
committed
privcmd_ioeventfd_assign(): don't open-code eventfd_ctx_fdget()
just call it, same as privcmd_ioeventfd_deassign() does... Signed-off-by: Al Viro <[email protected]>
1 parent 554ceb7 commit 46b5e18

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/xen/privcmd.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,6 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd)
13521352
struct privcmd_kernel_ioeventfd *kioeventfd;
13531353
struct privcmd_kernel_ioreq *kioreq;
13541354
unsigned long flags;
1355-
struct fd f;
13561355
int ret;
13571356

13581357
/* Check for range overflow */
@@ -1372,15 +1371,7 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd)
13721371
if (!kioeventfd)
13731372
return -ENOMEM;
13741373

1375-
f = fdget(ioeventfd->event_fd);
1376-
if (!fd_file(f)) {
1377-
ret = -EBADF;
1378-
goto error_kfree;
1379-
}
1380-
1381-
kioeventfd->eventfd = eventfd_ctx_fileget(fd_file(f));
1382-
fdput(f);
1383-
1374+
kioeventfd->eventfd = eventfd_ctx_fdget(ioeventfd->event_fd);
13841375
if (IS_ERR(kioeventfd->eventfd)) {
13851376
ret = PTR_ERR(kioeventfd->eventfd);
13861377
goto error_kfree;

0 commit comments

Comments
 (0)