]> git.ipfire.org Git - thirdparty/qemu.git/commit
qemu/queue.h: clear linked list pointers on remove
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 24 Feb 2020 10:34:05 +0000 (10:34 +0000)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 9 Mar 2020 16:39:20 +0000 (16:39 +0000)
commita31ca6801c027dbee2c589da85814b56eec563f6
tree6ca6c52710b3b4b7fb7d6594eebc01b752347f42
parent67f17e23baca5dd545fe98b01169cc351a70fe35
qemu/queue.h: clear linked list pointers on remove

Do not leave stale linked list pointers around after removal.  It's
safer to set them to NULL so that use-after-removal results in an
immediate segfault.

The RCU queue removal macros are unchanged since nodes may still be
traversed after removal.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Link: https://lore.kernel.org/r/20200224103406.1894923-2-stefanha@redhat.com
Message-Id: <20200224103406.1894923-2-stefanha@redhat.com>
include/qemu/queue.h