ui/pixman: Fix crash in qemu_pixman_shareable_free()
PATCH 1/1 ui/pixman: Fix crash in qemu_pixman_shareable_free()
--- ui/qemu-pixman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
ui/qemu-pixman.c +3 -1
@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif
Signature · 1 line
2.49.0
Quoted 6 lines · Markus Armbruster
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>--- ui/qemu-pixman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
With regards,
Daniel
Signature · 3 lines
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Quoted 12 lines · Markus Armbruster
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>--- ui/qemu-pixman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 293
Quoted 3 lines
ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;qemu_win32_map_free (ptr, handle, &err);
Slightly better if qemu_win32_map_free(), as per commit e3fe3988d78 ("error: Document Error API usage rules") recommended style:
+ * We recommend
+ * • bool-valued functions return true on success / false on failure, + * • pointer-valued functions return non-null / null pointer, and + * • integer-valued functions return non-negative / negative.
Anyhow,
Quoted 7 lines
ui/qemu-pixman.c +3
-1-error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif
Am 13. Oktober 2025 14:11:32 UTC schrieb "Philippe Mathieu-Daudé" <[email protected]>:
Quoted 19 lines · Markus Armbruster
Quoted 12 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>--- ui/qemu-pixman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 292
Quoted 2 lines
ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;qemu_win32_map_free (ptr, handle, &err);Slightly better if
qemu_win32_map_free(), as per commite3fe3988d78("error: Document Error API usage rules") recommended style:
Quoted 4 lines
+ * We recommend
+ * • bool-valued functions return true on success / false on failure, + * • pointer-valued functions return non-null / null pointer, and + * • integer-valued functions return non-negative / negative.
Now I see: Since qemu_win32_map_free() returns void, the pattern is to check for the error pointer. Could be mentioned in the commit message for educational porposes.
Anyhow,
Tested-by: Bernhard Beschow
Reviewed-by: Bernhard Beschow
Quoted 12 lines
Anyhow,
Reviewed-by Philippe Mathieu-Daudé <[email protected]>Quoted 7 lines
ui/qemu-pixman.c +3
-1-error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif
Quoted 20 lines · Philippe Mathieu-Daudé
Quoted 12 lines · Markus Armbruster
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>--- ui/qemu-pixman.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 293
Quoted 3 lines
ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;qemu_win32_map_free (ptr, handle, &err);Slightly better if
qemu_win32_map_free(), as per commite3fe3988d78("error: Document Error API usage rules") recommended style:
Quoted 4 lines
+ * We recommend
+ * • bool-valued functions return true on success / false on failure, + * • pointer-valued functions return non-null / null pointer, and + * • integer-valued functions return non-negative / negative.
I went fo a minimal fix.
I now see that this is the only use of qemu_win32_map_free(). Changing it to return bool would've been okay.
Quoted 2 lines
Anyhow,
Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Quoted 7 lines
Quoted 7 lines
ui/qemu-pixman.c +3
-1-error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif
Am 13. Oktober 2025 11:21:02 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 12 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>---
ui/qemu-pixman.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 299
Quoted 10 lines
ui/qemu-pixman.c +3
-1@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif
Thanks for the quick fix, Markus! The patch is reviewed and I've been testing it for a week. Who is going to merge it?
Best regards,
Bernhard
Quoted 15 lines · Bernhard Beschow
Am 13. Oktober 2025 11:21:02 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 14 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>---
ui/qemu-pixman.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;
Quoted 10 lines
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 299
Quoted 8 lines
ui/qemu-pixman.c +3
-1qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif Thanks for the quick fix, Markus! The patch is reviewed and I've been testing it for a week. Who is going to merge it?
I can do it.
You provided
without an e-mail address. Intentional? If not, should I use <[email protected]>?
Am 20. Oktober 2025 12:32:33 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 28 lines
Quoted 15 lines · Bernhard Beschow
Am 13. Oktober 2025 11:21:02 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 14 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>---
ui/qemu-pixman.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;Quoted 10 lines
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 299
Quoted 8 lines
ui/qemu-pixman.c +3
-1qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif Thanks for the quick fix, Markus! The patch is reviewed and I've been testing it for a week. Who is going to merge it?
Quoted 8 lines
I can do it.
You provided
Tested-by Bernhard BeschowReviewed-by Bernhard Beschowwithout an e-mail address. Intentional?
Oh, that wasn't intentional.
Quoted 1 line
If not, should I use <[email protected]>?
Yes, please.
Best regards,
Bernhard
Quoted 36 lines · Bernhard Beschow
Am 20. Oktober 2025 12:32:33 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 35 lines
Quoted 15 lines · Bernhard Beschow
Am 13. Oktober 2025 11:21:02 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 14 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>---
ui/qemu-pixman.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;Quoted 10 lines
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 299
Quoted 8 lines
ui/qemu-pixman.c +3
-1qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif Thanks for the quick fix, Markus! The patch is reviewed and I've been testing it for a week. Who is going to merge it?
I can do it.
You provided
Tested-by Bernhard BeschowReviewed-by Bernhard Beschow
Quoted 7 lines
Quoted 1 line
without an e-mail address. Intentional?
Oh, that wasn't intentional.
Quoted 1 line
If not, should I use <[email protected]>?
Yes, please.
Done, PR sent. Thank you!
Am 21. Oktober 2025 09:50:32 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 40 lines
Quoted 38 lines · Bernhard Beschow
Am 20. Oktober 2025 12:32:33 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 36 lines
Quoted 15 lines · Bernhard Beschow
Am 13. Oktober 2025 11:21:02 UTC schrieb Markus Armbruster <[email protected]>:
Quoted 14 lines
Reported-by Bernhard Beschow <[email protected]>Fixes b296b29d3414 (ui/pixman: Consistent error handling in qemu_pixman_shareable_free())Signed-off-by Markus Armbruster <[email protected]>---
ui/qemu-pixman.c| 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)ui/qemu-pixman.c +0
-0@@ -291,7 +291,9 @@ qemu_pixman_shareable_free(qemu_pixman_shareable handle,Error *err =NULL ;Quoted 10 lines
ui/qemu-pixman.c qemu_pixman_shareable_free(qemu_pixman_shareable handle, · line 299
Quoted 8 lines
ui/qemu-pixman.c +3
-1qemu_win32_map_free (ptr, handle, &err); -error_report_err (err); +if (err) { +error_report_err (err); + }#else qemu_memfd_free (ptr, size, handle);#endif Thanks for the quick fix, Markus! The patch is reviewed and I've been testing it for a week. Who is going to merge it?
I can do it.
You provided
Tested-by Bernhard BeschowReviewed-by Bernhard Beschowwithout an e-mail address. Intentional?
Quoted 7 lines
Quoted 5 lines
Oh, that wasn't intentional.
Quoted 1 line
If not, should I use <[email protected]>?
Yes, please.
Done, PR sent. Thank you!
Nice. Thanks!