[libvirt PATCH] conf: Initialize devAddr in virNodeDeviceGetPCIVPDDynamicCap

Jiri Denemark posted 1 patch 2 years, 2 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/1beaf5b9317503f8abea5869c64dea341c40d0b1.1644583155.git.jdenemar@redhat.com
src/conf/node_device_conf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt PATCH] conf: Initialize devAddr in virNodeDeviceGetPCIVPDDynamicCap
Posted by Jiri Denemark 2 years, 2 months ago
Otherwise devAddr.multi would be uninitialized.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/conf/node_device_conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 61c8715037..eaa42c05ee 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -3018,7 +3018,7 @@ static int
 virNodeDeviceGetPCIVPDDynamicCap(virNodeDevCapPCIDev *devCapPCIDev)
 {
     g_autoptr(virPCIDevice) pciDev = NULL;
-    virPCIDeviceAddress devAddr;
+    virPCIDeviceAddress devAddr = {0};
     g_autoptr(virPCIVPDResource) res = NULL;
 
     devAddr.domain = devCapPCIDev->domain;
-- 
2.35.0

Re: [libvirt PATCH] conf: Initialize devAddr in virNodeDeviceGetPCIVPDDynamicCap
Posted by Michal Prívozník 2 years, 2 months ago
On 2/11/22 13:39, Jiri Denemark wrote:
> Otherwise devAddr.multi would be uninitialized.
> 
> Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> ---
>  src/conf/node_device_conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Oh, there are more places like this. But it's not something that a small
spatch wouldn't solve. I'll post a follow up shortly.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>

Michal

Re: [libvirt PATCH] conf: Initialize devAddr in virNodeDeviceGetPCIVPDDynamicCap
Posted by Jiri Denemark 2 years, 2 months ago
On Fri, Feb 11, 2022 at 14:26:12 +0100, Michal Prívozník wrote:
> On 2/11/22 13:39, Jiri Denemark wrote:
> > Otherwise devAddr.multi would be uninitialized.
> > 
> > Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
> > ---
> >  src/conf/node_device_conf.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> 
> Oh, there are more places like this. But it's not something that a small
> spatch wouldn't solve. I'll post a follow up shortly.

OK, let's go with your patch which is a superset of this one.

Jirka