[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 21/22] qom/object: fix -Werror=maybe-uninitialized
From: |
marcandre . lureau |
Subject: |
[PATCH v3 21/22] qom/object: fix -Werror=maybe-uninitialized |
Date: |
Mon, 30 Sep 2024 12:14:56 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
object_resolve_path_type() didn't always set *ambiguousp.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
qom/object.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/qom/object.c b/qom/object.c
index 28c5b66eab..bdc8a2c666 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -2201,6 +2201,9 @@ Object *object_resolve_path_type(const char *path, const
char *typename,
}
} else {
obj = object_resolve_abs_path(object_get_root(), parts + 1, typename);
+ if (ambiguousp) {
+ *ambiguousp = false;
+ }
}
g_strfreev(parts);
@@ -2226,7 +2229,7 @@ Object *object_resolve_path_at(Object *parent, const char
*path)
Object *object_resolve_type_unambiguous(const char *typename, Error **errp)
{
- bool ambig;
+ bool ambig = false;
Object *o = object_resolve_path_type("", typename, &ambig);
if (ambig) {
--
2.45.2.827.g557ae147e6
- Re: [PATCH v3 06/22] block/mirror: fix -Werror=maybe-uninitialized false-positive, (continued)
- [PATCH v3 04/22] nbd: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 07/22] block/stream: fix -Werror=maybe-uninitialized false-positives, marcandre . lureau, 2024/09/30
- [PATCH v3 08/22] hw/ahci: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 11/22] block/block-copy: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 12/22] migration: fix -Werror=maybe-uninitialized false-positives, marcandre . lureau, 2024/09/30
- [PATCH v3 10/22] hw/sdhci: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 09/22] hw/vhost-scsi: fix -Werror=maybe-uninitialized, marcandre . lureau, 2024/09/30
- [PATCH v3 14/22] migration: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 21/22] qom/object: fix -Werror=maybe-uninitialized,
marcandre . lureau <=
- [PATCH v3 05/22] block/mirror: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 18/22] hw/virtio: fix -Werror=maybe-uninitialized, marcandre . lureau, 2024/09/30
- [PATCH v3 17/22] tests: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 16/22] target/loongarch: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 13/22] hw/virtio-blk: fix -Werror=maybe-uninitialized false-positive, marcandre . lureau, 2024/09/30
- [PATCH v3 19/22] RFC: hw/virtio: a potential leak fix, marcandre . lureau, 2024/09/30