diff options
author | Dave Airlie <airlied@redhat.com> | 2023-12-12 04:32:33 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2023-12-12 04:32:33 +0300 |
commit | c1ee197d64f49c9e2a6c8e6a168083c411c1362c (patch) | |
tree | ec8568a9d11ce55989c212efc4769cccc680964e /io_uring/cancel.c | |
parent | a60501d7c2d3e70b3545b9b96576628e369d8e85 (diff) | |
parent | a39b6ac3781d46ba18193c9dbb2110f31e9bffe9 (diff) | |
download | linux-c1ee197d64f49c9e2a6c8e6a168083c411c1362c.tar.xz |
Backmerge tag 'v6.7-rc5' into drm-next
Linux 6.7-rc5
Alex requested this for some amdkfd work relying on the symbols exports.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'io_uring/cancel.c')
-rw-r--r-- | io_uring/cancel.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/io_uring/cancel.c b/io_uring/cancel.c index 3c19cccb1aec..8a8b07dfc444 100644 --- a/io_uring/cancel.c +++ b/io_uring/cancel.c @@ -273,7 +273,7 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg) }; ktime_t timeout = KTIME_MAX; struct io_uring_sync_cancel_reg sc; - struct fd f = { }; + struct file *file = NULL; DEFINE_WAIT(wait); int ret, i; @@ -295,10 +295,10 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg) /* we can grab a normal file descriptor upfront */ if ((cd.flags & IORING_ASYNC_CANCEL_FD) && !(cd.flags & IORING_ASYNC_CANCEL_FD_FIXED)) { - f = fdget(sc.fd); - if (!f.file) + file = fget(sc.fd); + if (!file) return -EBADF; - cd.file = f.file; + cd.file = file; } ret = __io_sync_cancel(current->io_uring, &cd, sc.fd); @@ -348,6 +348,7 @@ int io_sync_cancel(struct io_ring_ctx *ctx, void __user *arg) if (ret == -ENOENT || ret > 0) ret = 0; out: - fdput(f); + if (file) + fput(file); return ret; } |