Fix crash with --debug=file and NULL file return
[fio.git] / io_u.c
diff --git a/io_u.c b/io_u.c
index 619fa25255f84ee785eccedcf7f96bfe94b41ab4..a69efb76c2d727cd3f5e883382270f4a3d53cc14 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -1093,7 +1093,10 @@ static struct fio_file *__get_next_file(struct thread_data *td)
        td->file_service_file = f;
        td->file_service_left = td->file_service_nr - 1;
 out:
-       dprint(FD_FILE, "get_next_file: %p [%s]\n", f, f->file_name);
+       if (f)
+               dprint(FD_FILE, "get_next_file: %p [%s]\n", f, f->file_name);
+       else
+               dprint(FD_FILE, "get_next_file: NULL\n");
        return f;
 }