From: Jens Axboe Date: Tue, 25 Feb 2014 21:43:17 +0000 (-0800) Subject: Fix crash with --debug=file and NULL file return X-Git-Tag: fio-2.1.6~16 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=0dac421f0fcd500d658d2fd68bc16416885a874a;ds=sidebyside Fix crash with --debug=file and NULL file return Don't attempt to dereference that, obviously. Signed-off-by: Jens Axboe --- diff --git a/io_u.c b/io_u.c index 619fa252..a69efb76 100644 --- 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; }