summary refs log tree commit diff stats
path: root/tests/test-thread-pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-thread-pool.c')
-rw-r--r--tests/test-thread-pool.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test-thread-pool.c b/tests/test-thread-pool.c
index c1f8e13a9f..aa156bcd32 100644
--- a/tests/test-thread-pool.c
+++ b/tests/test-thread-pool.c
@@ -180,7 +180,7 @@ static void test_cancel(void)
 
     /* Canceling the others will be a blocking operation.  */
     for (i = 0; i < 100; i++) {
-        if (data[i].n != 3) {
+        if (data[i].aiocb && data[i].n != 3) {
             bdrv_aio_cancel(data[i].aiocb);
         }
     }