aboutsummaryrefslogtreecommitdiff
path: root/device
diff options
context:
space:
mode:
authorJoan Lledó <jlledom@member.fsf.org>2022-08-09 10:25:29 +0200
committerJoan Lledó <jlledom@member.fsf.org>2022-08-09 10:25:29 +0200
commit0e53658a0c0444a28d7a1858b311d811b9018f60 (patch)
tree056b9b505a34cedc5dbce3e2b7e5bebf98c37c5f /device
parentd179d9f1f6249b89acc66223c9cff33b2f1b5e4e (diff)
downloadgnumach-0e53658a0c0444a28d7a1858b311d811b9018f60.tar.gz
gnumach-0e53658a0c0444a28d7a1858b311d811b9018f60.tar.bz2
gnumach-0e53658a0c0444a28d7a1858b311d811b9018f60.zip
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
Diffstat (limited to 'device')
-rw-r--r--device/dev_pager.c4
1 files changed, 2 insertions, 2 deletions
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);
}