git: 495bdd698e42 - stable/14 - linuxkpi: remove invalid KASSERT from hash_add_rcu

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 25 Mar 2024 22:32:20 UTC
The branch stable/14 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=495bdd698e426a5f19ed13a73062c2158618f7b7

commit 495bdd698e426a5f19ed13a73062c2158618f7b7
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-01-29 14:25:40 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-03-25 22:31:44 +0000

    linuxkpi: remove invalid KASSERT from hash_add_rcu
    
    hash_add_rcu asserted that the node's prev pointer was NULL in an
    attempt to detect addition of a node already on a list, but the caller
    is not required to provide a zeroed node.
    
    Reported in https://github.com/freebsd/drm-kmod/issues/282
    
    Reviewed by:    bz, manu
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D43645
    
    (cherry picked from commit 7e77089dccd702eb767350a8bd3d20102c4fb591)
---
 sys/compat/linuxkpi/common/include/linux/hashtable.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/sys/compat/linuxkpi/common/include/linux/hashtable.h b/sys/compat/linuxkpi/common/include/linux/hashtable.h
index 5703d6282ad7..55755c354959 100644
--- a/sys/compat/linuxkpi/common/include/linux/hashtable.h
+++ b/sys/compat/linuxkpi/common/include/linux/hashtable.h
@@ -92,8 +92,6 @@ __hash_node_type_assert(struct hlist_node *node)
 #define	hash_add_rcu(ht, node, key) do {				\
 	struct lkpi_hash_head *__head = &(ht)[hash_min(key, HASH_BITS(ht))]; \
 	__hash_node_type_assert(node); \
-	KASSERT(((struct lkpi_hash_entry *)(node))->entry.cle_prev == NULL, \
-	    ("node is already on list or was not zeroed")); \
 	CK_LIST_INSERT_HEAD(&__head->head, \
 	    (struct lkpi_hash_entry *)(node), entry); \
 } while (0)