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 <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Tim Wiederhake 2021-02-01 13:42:03 +01:00 committed by Peter Krempa
parent 1e2e8ac88f
commit 795187fe0c

View File

@ -1100,7 +1100,7 @@ static int
udevProcessCCW(struct udev_device *device, udevProcessCCW(struct udev_device *device,
virNodeDeviceDefPtr def) virNodeDeviceDefPtr def)
{ {
int online; int online = 0;
/* process only online devices to keep the list sane */ /* process only online devices to keep the list sane */
if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != 1) if (udevGetIntSysfsAttr(device, "online", &online, 0) < 0 || online != 1)