[PATCH v1] util: vircommand: fix redundant if

2023-10-10 Thread Dmitry Frolov
Comparisson "if(ret == -1)" is always false. This statement was forgotten during switching to g_new0() Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 0275b06a55fc7b1ec6a9e93f7fb73bea7388f634 ("util: command: use g_new0") Signed-off-by: Dmitry F

[PATCH] fix uint64 underflow

2023-09-12 Thread Dmitry Frolov
According to previous statement, 'free_mem' is less than 'needed_mem'. So, the subtraction 'free_mem - needed_mem' is negative, and will raise uint64 underflow. Signed-off-by: Dmitry Frolov --- src/libxl/libxl_domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src

[PATCH v3] interface: fix udev_device_get_sysattr_value return value check

2023-09-12 Thread Dmitry Frolov
earlier. More verbose VIR_DEBUG. Signed-off-by: Dmitry Frolov --- src/interface/interface_backend_udev.c | 26 +++--- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c index a0485ddd21

[PATCH v2] interface: fix udev_device_get_sysattr_value return value check

2023-09-08 Thread Dmitry Frolov
Reviewing the code I found that return value of function udev_device_get_sysattr_value() is dereferenced without a check. udev_device_get_sysattr_value() may return NULL by number of reasons. v2: VIR_DEBUG added, replaced STREQ(NULLSTR()) with STREQ_NULLABLE() Signed-off-by: Dmitry Frolov

[PATCH] interface: fix udev_device_get_sysattr_value return value check

2023-09-08 Thread Dmitry Frolov
Reviewing the code I found that return value of function udev_device_get_sysattr_value() is dereferenced without a check. udev_device_get_sysattr_value() may return NULL by number of reasons. Signed-off-by: Dmitry Frolov --- src/interface/interface_backend_udev.c | 11 ++- 1 file

[PATCH v2] lxc: fix lxcContainerMountAllFS() DEREF_BEFORE_CHECK

2023-09-07 Thread Dmitry Frolov
vmDef->fss[i]->src->path may be NULL, so check is needed before passing it to VIR_DEBUG. Also removed checking vmDef->fss[i]->src for NULL, since it may not be NULL. Fixes: 57487085dc ("lxc: don't try to reference NULL when mounting filesystems") Signed-off-by: Dm

[PATCH] lxc: fix lxcContainerMountAllFS() DEREF_BEFORE_CHECK

2023-09-06 Thread Dmitry Frolov
Reviewing the sources, I found, that in function lxcContainerMountAllFS() pointers vmDef->fss[i]->src and vmDef->fss[i]->src->path are checked for NULL after dereferencing in VIR_DEBUG() macro. Fixes: 57487085dc ("lxc: don't try to reference NULL when mounting filesystems") ---

[PATCH] fix virCgroupGetMemoryStat arguments order

2023-09-05 Thread Dmitry Frolov
tive_file is passed; -instead of *inactiveFile, >active_file is passed. Fixes: e634c7cd0d ("lxc: Use virCgroupGetMemoryStat") Signed-off-by: Dmitry Frolov --- src/lxc/lxc_cgroup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_cgroup.c b/src/