From: Jens Axboe Date: Wed, 10 Sep 2008 07:07:55 +0000 (+0200) Subject: filehash: check for NULL ->file_name in hash lookup X-Git-Tag: fio-1.22-rc1~3 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=8954110682922232b8bccfe2b7e734d04ce71b96;ds=sidebyside filehash: check for NULL ->file_name in hash lookup Original patch from Shaozhi Shawn Ye , modified by me to continue the lookup and just skip the file instead of returning NULL. Signed-off-by: Jens Axboe --- diff --git a/filehash.c b/filehash.c index a00ac788..dab60fe3 100644 --- a/filehash.c +++ b/filehash.c @@ -39,6 +39,9 @@ static struct fio_file *__lookup_file_hash(const char *name) flist_for_each(n, bucket) { struct fio_file *f = flist_entry(n, struct fio_file, hash_list); + if (!f->file_name) + continue; + if (!strcmp(f->file_name, name)) { assert(f->fd != -1); return f;