From: Emilio G. Cota Date: Sun, 19 Aug 2018 09:13:25 +0000 (-0400) Subject: rcu_queue: use atomic_set in QLIST_REMOVE_RCU X-Git-Tag: v3.1.0-rc0~119^2~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c177e0bf063659427874bf78236a762b5f040546;p=thirdparty%2Fqemu.git rcu_queue: use atomic_set in QLIST_REMOVE_RCU To avoid undefined behaviour. Signed-off-by: Emilio G. Cota Message-Id: <20180819091335.22863-2-cota@braap.org> Signed-off-by: Paolo Bonzini --- diff --git a/include/qemu/rcu_queue.h b/include/qemu/rcu_queue.h index 01be77407ba..dd7b3be043e 100644 --- a/include/qemu/rcu_queue.h +++ b/include/qemu/rcu_queue.h @@ -112,7 +112,7 @@ extern "C" { (elm)->field.le_next->field.le_prev = \ (elm)->field.le_prev; \ } \ - *(elm)->field.le_prev = (elm)->field.le_next; \ + atomic_set((elm)->field.le_prev, (elm)->field.le_next); \ } while (/*CONSTCOND*/0) /* List traversal must occur within an RCU critical section. */