From f102c3094f48fe837e9266c26baaa2ca3e256305 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Thu, 11 May 2023 10:44:13 +0200 Subject: [PATCH] infra: tighten list checking --- kernel/brick_checking.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kernel/brick_checking.h b/kernel/brick_checking.h index e951673c..7760bcce 100644 --- a/kernel/brick_checking.h +++ b/kernel/brick_checking.h @@ -50,7 +50,11 @@ do { \ #define CHECK_HEAD_EMPTY(head) \ do { \ - if (BRICK_CHECKING && unlikely(!list_empty(head) && (head)->next)) { \ + if (BRICK_CHECKING && \ + unlikely(!list_empty(head) && \ + (head)->next && \ + (head)->next != LIST_POISON1 && \ + (head)->prev != LIST_POISON2)) { \ list_del_init(head); \ BRICK_ERR("%d: list_head " #head " (%p) not empty\n", __LINE__, head); \ } \