diff options
author | Emilio G. Cota <cota@braap.org> | 2018-08-19 05:13:25 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-08-23 18:46:25 +0200 |
commit | c177e0bf063659427874bf78236a762b5f040546 (patch) | |
tree | ddeabf3ca2978cb0bfb2db6ac32ef66e16a3f4b1 | |
parent | db7196db5d5d932f388643baae6835f8dcda6921 (diff) | |
download | qemu-c177e0bf063659427874bf78236a762b5f040546.zip qemu-c177e0bf063659427874bf78236a762b5f040546.tar.gz qemu-c177e0bf063659427874bf78236a762b5f040546.tar.bz2 |
rcu_queue: use atomic_set in QLIST_REMOVE_RCU
To avoid undefined behaviour.
Signed-off-by: Emilio G. Cota <cota@braap.org>
Message-Id: <20180819091335.22863-2-cota@braap.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | include/qemu/rcu_queue.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/qemu/rcu_queue.h b/include/qemu/rcu_queue.h index 01be774..dd7b3be 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. */ |