mmap_cache: fool-proofing build_mmap_cache
authorEugene Syromyatnikov <evgsyr@gmail.com>
Wed, 2 May 2018 18:20:38 +0000 (20:20 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Thu, 3 May 2018 00:09:53 +0000 (00:09 +0000)
commitee023f97ab799461b49b6a3b94250c76e38f281c
treeb97d5fd7132ab47fb73ce89f3e90a10e6b20c979
parentf08a679a1df67ff20072dcd6d49c3dabf174f6b0
mmap_cache: fool-proofing build_mmap_cache

Let's try to handle better the situation when build_mmap_cache is called
without mmap_cache/mmap_cache_size being reset prior to the call.

Reported by Coverity scan.

* mmap_cache.c (build_mmap_cache): Set cache_head to tcp->mmap_cache.
Reset tcp->mmap_cache_size to 0.
mmap_cache.c