[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/34] qga: Fix guest-get-fsinfo error API violations
From: |
Markus Armbruster |
Subject: |
[PULL 10/34] qga: Fix guest-get-fsinfo error API violations |
Date: |
Tue, 17 Dec 2019 07:26:27 +0100 |
build_guest_fsinfo_for_virtual_device() dereferences @errp when
build_guest_fsinfo_for_device() fails. That's wrong; see the big
comment in error.h. Introduced in commit 46d4c5723e "qga: Add
guest-get-fsinfo command".
No caller actually passes null.
Fix anyway: splice in a local Error *err, and error_propagate().
Cc: Michael Roth <address@hidden>
Signed-off-by: Markus Armbruster <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
qga/commands-posix.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 0be301a4ea..10d818c3b2 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1060,6 +1060,7 @@ static void build_guest_fsinfo_for_virtual_device(char
const *syspath,
GuestFilesystemInfo *fs,
Error **errp)
{
+ Error *err = NULL;
DIR *dir;
char *dirpath;
struct dirent *entry;
@@ -1089,10 +1090,11 @@ static void build_guest_fsinfo_for_virtual_device(char
const *syspath,
g_debug(" slave device '%s'", entry->d_name);
path = g_strdup_printf("%s/slaves/%s", syspath, entry->d_name);
- build_guest_fsinfo_for_device(path, fs, errp);
+ build_guest_fsinfo_for_device(path, fs, &err);
g_free(path);
- if (*errp) {
+ if (err) {
+ error_propagate(errp, err);
break;
}
}
--
2.21.0
- [PULL 11/34] memory-device: Fix memory pre-plug error API violations, (continued)
- [PULL 11/34] memory-device: Fix memory pre-plug error API violations, Markus Armbruster, 2019/12/17
- [PULL 08/34] hw/core: Fix fit_load_fdt() error API violations, Markus Armbruster, 2019/12/17
- [PULL 03/34] crypto: Fix typo in QCryptoTLSSession's <example> comment, Markus Armbruster, 2019/12/17
- [PULL 13/34] hw/intc/s390: Simplify error handling in kvm_s390_flic_realize(), Markus Armbruster, 2019/12/17
- [PULL 05/34] tests: Clean up initialization of Error *err variables, Markus Armbruster, 2019/12/17
- [PULL 07/34] hw/acpi: Fix legacy CPU plug error API violations, Markus Armbruster, 2019/12/17
- [PULL 26/34] monitor/qmp-cmds: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/17
- [PULL 33/34] hw/vfio/ap: drop local_err from vfio_ap_realize, Markus Armbruster, 2019/12/17
- [PULL 09/34] hw/ipmi: Fix realize() error API violations, Markus Armbruster, 2019/12/17
- [PULL 29/34] hw/tpm: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/17
- [PULL 10/34] qga: Fix guest-get-fsinfo error API violations,
Markus Armbruster <=
- [PULL 06/34] exec: Fix file_ram_alloc() error API violations, Markus Armbruster, 2019/12/17
- [PULL 15/34] net/net: Clean up variable shadowing in net_client_init(), Markus Armbruster, 2019/12/17
- [PULL 16/34] error: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/17
- [PULL 28/34] hw/sd: drop extra whitespace in sdhci_sysbus_realize() header, Markus Armbruster, 2019/12/17
- [PULL 19/34] qdev-monitor: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/17
- [PULL 18/34] vnc: drop Error pointer indirection in vnc_client_io_error, Markus Armbruster, 2019/12/17
- [PULL 23/34] block/snapshot: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/17
- [PULL 32/34] backends/cryptodev: drop local_err from cryptodev_backend_complete(), Markus Armbruster, 2019/12/17
- [PULL 34/34] nbd: assert that Error** is not NULL in nbd_iter_channel_error, Markus Armbruster, 2019/12/17