summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--block/curl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/block/curl.c b/block/curl.c
index 16e7db8eea..d2f1084b91 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -220,7 +220,8 @@ static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len,
         }
 
         // Wait for unfinished chunks
-        if ((start >= state->buf_start) &&
+        if (state->in_use &&
+            (start >= state->buf_start) &&
             (start <= buf_fend) &&
             (end >= state->buf_start) &&
             (end <= buf_fend))