@@ -375,7 +375,8 @@ struct io_ring_ctx_rings {
375
375
struct io_rings * rings ;
376
376
};
377
377
378
- static void io_register_free_rings (struct io_uring_params * p ,
378
+ static void io_register_free_rings (struct io_ring_ctx * ctx ,
379
+ struct io_uring_params * p ,
379
380
struct io_ring_ctx_rings * r )
380
381
{
381
382
if (!(p -> flags & IORING_SETUP_NO_MMAP )) {
@@ -455,7 +456,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
455
456
n .rings -> cq_ring_entries = p .cq_entries ;
456
457
457
458
if (copy_to_user (arg , & p , sizeof (p ))) {
458
- io_register_free_rings (& p , & n );
459
+ io_register_free_rings (ctx , & p , & n );
459
460
return - EFAULT ;
460
461
}
461
462
@@ -464,7 +465,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
464
465
else
465
466
size = array_size (sizeof (struct io_uring_sqe ), p .sq_entries );
466
467
if (size == SIZE_MAX ) {
467
- io_register_free_rings (& p , & n );
468
+ io_register_free_rings (ctx , & p , & n );
468
469
return - EOVERFLOW ;
469
470
}
470
471
@@ -475,7 +476,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
475
476
p .sq_off .user_addr ,
476
477
size );
477
478
if (IS_ERR (ptr )) {
478
- io_register_free_rings (& p , & n );
479
+ io_register_free_rings (ctx , & p , & n );
479
480
return PTR_ERR (ptr );
480
481
}
481
482
@@ -565,7 +566,7 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
565
566
out :
566
567
spin_unlock (& ctx -> completion_lock );
567
568
mutex_unlock (& ctx -> mmap_lock );
568
- io_register_free_rings (& p , to_free );
569
+ io_register_free_rings (ctx , & p , to_free );
569
570
570
571
if (ctx -> sq_data )
571
572
io_sq_thread_unpark (ctx -> sq_data );
0 commit comments