From: Mahmoud Mandour Date: Tue, 20 Jul 2021 23:26:55 +0000 (+0100) Subject: plugins/cache: Fixed a bug with destroying FIFO metadata X-Git-Tag: v6.1.0-rc1~8^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de9fc40f36ab8e696d1c69727e80a80c46f20978;p=thirdparty%2Fqemu.git plugins/cache: Fixed a bug with destroying FIFO metadata This manifests itself when associativity degree is greater than the number of sets and FIFO is used, otherwise it's also a memory leak whenever FIFO was used. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Reviewed-by: Alex Bennée Message-Id: <20210714172151.8494-2-ma.mandourr@gmail.com> Message-Id: <20210720232703.10650-22-alex.bennee@linaro.org> --- diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index bf0d2f60973..4a71602639e 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -200,7 +200,7 @@ static void fifo_destroy(Cache *cache) { int i; - for (i = 0; i < cache->assoc; i++) { + for (i = 0; i < cache->num_sets; i++) { g_queue_free(cache->sets[i].fifo_queue); } }