[libvirt] [PATCH 04/21] qemu: qapi: Fix return value of impossible case in virQEMUQAPISchemaTraverse

Peter Krempa posted 21 patches 6 years, 9 months ago
[libvirt] [PATCH 04/21] qemu: qapi: Fix return value of impossible case in virQEMUQAPISchemaTraverse
Posted by Peter Krempa 6 years, 9 months ago
The return statement after the infinite loop without a break is there to
appease the compiler. Make it return NULL as it would be a failure if
control flow reaches that point.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_qapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c
index 90df50ec77..de663d4408 100644
--- a/src/qemu/qemu_qapi.c
+++ b/src/qemu/qemu_qapi.c
@@ -164,7 +164,7 @@ virQEMUQAPISchemaTraverse(const char *baseName,
         query++;
     }

-    return base;
+    return NULL;
 }


-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 04/21] qemu: qapi: Fix return value of impossible case in virQEMUQAPISchemaTraverse
Posted by Ján Tomko 6 years, 9 months ago
On Mon, Apr 15, 2019 at 06:01:57PM +0200, Peter Krempa wrote:
>The return statement after the infinite loop without a break is there to
>appease the compiler. Make it return NULL as it would be a failure if
>control flow reaches that point.
>
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_qapi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list