[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 12/13] vl: fix "type is NULL" in -vga help
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 12/13] vl: fix "type is NULL" in -vga help |
Date: |
Tue, 16 Jul 2024 20:09:39 +0200 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Don't pass NULL to module_object_class_by_name(), when the interface is
unavailable.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20240715114420.2062870-1-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
system/vl.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index bdd2f6ecf6..9e8f16f155 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -1000,9 +1000,16 @@ static bool vga_interface_available(VGAInterfaceType t)
const VGAInterfaceInfo *ti = &vga_interfaces[t];
assert(t < VGA_TYPE_MAX);
- return !ti->class_names[0] ||
- module_object_class_by_name(ti->class_names[0]) ||
- module_object_class_by_name(ti->class_names[1]);
+
+ if (!ti->class_names[0] ||
module_object_class_by_name(ti->class_names[0])) {
+ return true;
+ }
+
+ if (ti->class_names[1] && module_object_class_by_name(ti->class_names[1]))
{
+ return true;
+ }
+
+ return false;
}
static const char *
--
2.41.0
- [PULL 03/13] include/hw/qdev-core.h: Correct and clarify gpio doc comments, (continued)
- [PULL 03/13] include/hw/qdev-core.h: Correct and clarify gpio doc comments, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 04/13] loader: remove load_image_gzipped function as its not used anywhere, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 05/13] accel/tcg: Make cpu_exec_interrupt hook mandatory, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 06/13] system/cpus: Add cpu_pause() function, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 07/13] esp: remove transfer size check from DMA DATA IN and DATA OUT transfers, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 08/13] ui/cocoa: Release CGColorSpace, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 09/13] ui/console: Convert mouse visibility parameter into bool, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 13/13] system/physmem: use return value of ram_block_discard_require() as errno, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 10/13] ui/cocoa: Add cursor composition, Philippe Mathieu-Daudé, 2024/07/16
- [PULL 11/13] ui/console: Remove dpy_cursor_define_supported(), Philippe Mathieu-Daudé, 2024/07/16
- [PULL 12/13] vl: fix "type is NULL" in -vga help,
Philippe Mathieu-Daudé <=
- Re: [PULL 00/13] Misc HW/UI patches for 2024-07-16, Richard Henderson, 2024/07/17