From: Willy Tarreau Date: Fri, 25 Feb 2022 08:56:29 +0000 (+0100) Subject: BUG/MINOR: debug: fix get_tainted() to properly read an atomic value X-Git-Tag: v2.6-dev2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9b4a0e6bace4e6ecd523a8d303abc948ee46aefd;p=thirdparty%2Fhaproxy.git BUG/MINOR: debug: fix get_tainted() to properly read an atomic value get_tainted() was using an atomic store from the atomic value to a local one instead of using an atomic load. In practice it has no effect given the relatively rare updates of this field and the fact that it's read only when dumping "show info" output, but better fix it. There's probably no need to backport this. --- diff --git a/src/haproxy.c b/src/haproxy.c index 0010e90f9e..7a659f798c 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1456,9 +1456,7 @@ void mark_tainted(const enum tainted_flags flag) unsigned int get_tainted() { - int tainted_state; - HA_ATOMIC_STORE(&tainted_state, tainted); - return tainted_state; + return HA_ATOMIC_LOAD(&tainted); }