[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 10/35] qga: Fix guest-get-fsinfo error API violations
From: |
Markus Armbruster |
Subject: |
[PULL v2 10/35] qga: Fix guest-get-fsinfo error API violations |
Date: |
Wed, 18 Dec 2019 09:16:56 +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 v2 00/35] Error reporting patches for 2019-12-17, Markus Armbruster, 2019/12/18
- [PULL v2 01/35] error: Fix -msg timestamp default, Markus Armbruster, 2019/12/18
- [PULL v2 02/35] crypto: Fix certificate file error handling crash bug, Markus Armbruster, 2019/12/18
- [PULL v2 18/35] vnc: drop Error pointer indirection in vnc_client_io_error, Markus Armbruster, 2019/12/18
- [PULL v2 20/35] Revert "ppc: well form kvmppc_hint_smt_possible error hint helper", Markus Armbruster, 2019/12/18
- [PULL v2 14/35] tests-blockjob: Use error_free_or_abort(), Markus Armbruster, 2019/12/18
- [PULL v2 07/35] hw/acpi: Fix legacy CPU plug error API violations, Markus Armbruster, 2019/12/18
- [PULL v2 06/35] exec: Fix file_ram_alloc() error API violations, Markus Armbruster, 2019/12/18
- [PULL v2 05/35] tests: Clean up initialization of Error *err variables, Markus Armbruster, 2019/12/18
- [PULL v2 10/35] qga: Fix guest-get-fsinfo error API violations,
Markus Armbruster <=
- [PULL v2 21/35] ppc: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/18
- [PULL v2 11/35] memory-device: Fix memory pre-plug error API violations, Markus Armbruster, 2019/12/18
- [PULL v2 25/35] hw/i386/amd_iommu: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/18
- [PULL v2 19/35] qdev-monitor: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/18
- [PULL v2 22/35] 9pfs: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/18
- [PULL v2 13/35] hw/intc/s390: Simplify error handling in kvm_s390_flic_realize(), Markus Armbruster, 2019/12/18
- [PULL v2 30/35] hw/tpm: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/18
- [PULL v2 27/35] monitor/qmp-cmds: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/18
- [PULL v2 26/35] qga: rename Error ** parameter to more common errp, Markus Armbruster, 2019/12/18
- [PULL v2 16/35] error: make Error **errp const where it is appropriate, Markus Armbruster, 2019/12/18