From 029f99dcc4b3dc4e08605f4f8a2ecc8854d0e937 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Sat, 9 Apr 2016 09:24:05 +0000 Subject: [PATCH] Make the KASSERT message in hash destroy more informative. While the pointer might not be too helpful, the malloc type might at least give a good hint about which hashtbl we are talking. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Reviewed by: gnn, emaste Differential Revision: https://reviews.freebsd.org/D5802 --- sys/kern/subr_hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/subr_hash.c b/sys/kern/subr_hash.c index 5533882d6f3..fe812869159 100644 --- a/sys/kern/subr_hash.c +++ b/sys/kern/subr_hash.c @@ -93,7 +93,8 @@ hashdestroy(void *vhashtbl, struct malloc_type *type, u_long hashmask) hashtbl = vhashtbl; for (hp = hashtbl; hp <= &hashtbl[hashmask]; hp++) - KASSERT(LIST_EMPTY(hp), ("%s: hash not empty", __func__)); + KASSERT(LIST_EMPTY(hp), ("%s: hashtbl %p not empty " + "(malloc type %s)", __func__, hashtbl, type->ks_shortdesc)); free(hashtbl, type); }