All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qga: Fix crash due to redundant error setting in qmp_guest_file_open()
@ 2026-01-22  4:04 Wei Wang
  2026-01-22  8:50 ` Daniel P. Berrangé
  2026-01-22  8:57 ` Markus Armbruster
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Wang @ 2026-01-22  4:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: kkostiuk, michael.roth, Wei Wang

Avoid setting GError multiple times in qmp_guest_file_open() by checking
if errp is already set.
This prevents crash caused by repeated error handling calls.

Signed-off-by: Wei Wang <wei.wang@smartx.com>
---
 qga/commands-win32.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 0fd0c966e4..8c45ca5004 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -263,7 +263,9 @@ int64_t qmp_guest_file_open(const char *path, const char *mode, Error **errp)
     fd = guest_file_handle_add(fh, errp);
     if (fd < 0) {
         CloseHandle(fh);
-        error_setg(errp, "failed to add handle to qmp handle table");
+        if (!*errp) {
+            error_setg(errp, "failed to add handle to qmp handle table");
+        }
         goto done;
     }
 
-- 
2.39.5 (Apple Git-154)



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-01-22  9:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-22  4:04 [PATCH] qga: Fix crash due to redundant error setting in qmp_guest_file_open() Wei Wang
2026-01-22  8:50 ` Daniel P. Berrangé
2026-01-22  8:57 ` Markus Armbruster
2026-01-22  9:01   ` Kostiantyn Kostiuk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.