From 795187fe0ca010e240101286fa3d634c128bd419 Mon Sep 17 00:00:00 2001 From: Tim Wiederhake Date: Mon, 1 Feb 2021 13:42:03 +0100 Subject: [PATCH] udevProcessCCW: Initialize variable `udevGetIntSysfsAttr` does not necessarily write to the third parameter, even when it returns 0. This was found by clang-tidy's "clang-analyzer-core.UndefinedBinaryOperatorResult" check. Signed-off-by: Tim Wiederhake Reviewed-by: Peter Krempa --- src/node_device/node_device_udev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c index fceb135aa5..09048fb23f 100644 --- a/src/node_device/node_device_udev.c +++ b/src/node_device/node_device_udev.c @@ -1100,7 +1100,7 @@ static int udevProcessCCW(struct udev_device *device, virNodeDeviceDefPtr def) { - int online; + int online = 0; /* process only online devices to keep the list sane */ if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != 1)