mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-12-28 16:56:26 +00:00
privcmd_ioeventfd_assign(): don't open-code eventfd_ctx_fdget()
just call it, same as privcmd_ioeventfd_deassign() does... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
554ceb7a5e
commit
46b5e18ae8
@ -1352,7 +1352,6 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd)
|
||||
struct privcmd_kernel_ioeventfd *kioeventfd;
|
||||
struct privcmd_kernel_ioreq *kioreq;
|
||||
unsigned long flags;
|
||||
struct fd f;
|
||||
int ret;
|
||||
|
||||
/* Check for range overflow */
|
||||
@ -1372,15 +1371,7 @@ static int privcmd_ioeventfd_assign(struct privcmd_ioeventfd *ioeventfd)
|
||||
if (!kioeventfd)
|
||||
return -ENOMEM;
|
||||
|
||||
f = fdget(ioeventfd->event_fd);
|
||||
if (!fd_file(f)) {
|
||||
ret = -EBADF;
|
||||
goto error_kfree;
|
||||
}
|
||||
|
||||
kioeventfd->eventfd = eventfd_ctx_fileget(fd_file(f));
|
||||
fdput(f);
|
||||
|
||||
kioeventfd->eventfd = eventfd_ctx_fdget(ioeventfd->event_fd);
|
||||
if (IS_ERR(kioeventfd->eventfd)) {
|
||||
ret = PTR_ERR(kioeventfd->eventfd);
|
||||
goto error_kfree;
|
||||
|
Loading…
Reference in New Issue
Block a user