From 0e53658a0c0444a28d7a1858b311d811b9018f60 Mon Sep 17 00:00:00 2001 From: Joan Lledó Date: Tue, 9 Aug 2022 10:25:29 +0200 Subject: dev_pager.c: fix wrong condition to remove entries * device/dev_pager.c: * dev_pager_hash_delete() and dev_device_hash_delete(): * Fix condition to call kmem_cache_free(), it was being called always. * https://lists.gnu.org/archive/html/bug-hurd/2022-08/msg00002.html --- device/dev_pager.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'device') diff --git a/device/dev_pager.c b/device/dev_pager.c index 38f0f8d4..6729d507 100644 --- a/device/dev_pager.c +++ b/device/dev_pager.c @@ -235,7 +235,7 @@ void dev_pager_hash_delete(const ipc_port_t name_port) } } simple_unlock(&dev_pager_hash_lock); - if (entry) + if (!queue_end(bucket, &entry->links)) kmem_cache_free(&dev_pager_hash_cache, (vm_offset_t)entry); } @@ -313,7 +313,7 @@ void dev_device_hash_delete( } } simple_unlock(&dev_device_hash_lock); - if (entry) + if (!queue_end(bucket, &entry->links)) kmem_cache_free(&dev_device_hash_cache, (vm_offset_t)entry); } -- cgit v1.2.3