From: Nicholas Piggin Date: Mon, 17 Mar 2025 03:20:49 +0000 (+1000) Subject: ppc/xive2: Fix logical / bitwise comparison typo X-Git-Tag: v10.0.0-rc1~6^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0b9357337e4005d7915d8c746eb3ce66c61fac0;p=thirdparty%2Fqemu.git ppc/xive2: Fix logical / bitwise comparison typo The comparison as written is always false (perhaps confusingly, because the functions/macros are not really booleans but return 0 or the tested bit value). Change to use logical-and. Resolves: Coverity CID 1593721 Reviewed-by: Cédric Le Goater Signed-off-by: Nicholas Piggin --- diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 311b42e15d..7d584dfafa 100644 --- a/hw/intc/xive2.c +++ b/hw/intc/xive2.c @@ -1344,7 +1344,7 @@ static void xive2_router_end_notify(Xive2Router *xrtr, uint8_t end_blk, return; } - if (xive2_end_is_crowd(&end) & !xive2_end_is_ignore(&end)) { + if (xive2_end_is_crowd(&end) && !xive2_end_is_ignore(&end)) { qemu_log_mask(LOG_GUEST_ERROR, "XIVE: invalid END, 'crowd' bit requires 'ignore' bit\n"); return;