Skip to content

Commit

Permalink
linuxkpi: remove invalid KASSERT from hash_add_rcu
Browse files Browse the repository at this point in the history
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 freebsd/drm-kmod#282

Reviewed by:	bz, manu
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D43645

(cherry picked from commit 7e77089)
  • Loading branch information
emaste committed Mar 25, 2024
1 parent 464fa66 commit 495bdd6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sys/compat/linuxkpi/common/include/linux/hashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 495bdd6

Please sign in to comment.