diff options
| -rw-r--r-- | fs/io_uring.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 576d9c652b4c..249a1e4e60e6 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c | |||
| @@ -2454,10 +2454,11 @@ static int io_sq_offload_start(struct io_ring_ctx *ctx, | |||
| 2454 | ctx->sq_thread_idle = HZ; | 2454 | ctx->sq_thread_idle = HZ; |
| 2455 | 2455 | ||
| 2456 | if (p->flags & IORING_SETUP_SQ_AFF) { | 2456 | if (p->flags & IORING_SETUP_SQ_AFF) { |
| 2457 | int cpu = array_index_nospec(p->sq_thread_cpu, | 2457 | int cpu = p->sq_thread_cpu; |
| 2458 | nr_cpu_ids); | ||
| 2459 | 2458 | ||
| 2460 | ret = -EINVAL; | 2459 | ret = -EINVAL; |
| 2460 | if (cpu >= nr_cpu_ids) | ||
| 2461 | goto err; | ||
| 2461 | if (!cpu_online(cpu)) | 2462 | if (!cpu_online(cpu)) |
| 2462 | goto err; | 2463 | goto err; |
| 2463 | 2464 | ||
