[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] vl: fix "type is NULL" in -vga help
|
From: |
marcandre . lureau |
|
Subject: |
[PATCH] vl: fix "type is NULL" in -vga help |
|
Date: |
Mon, 15 Apr 2024 15:15:23 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Don't pass NULL to module_object_class_by_name().
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
system/vl.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index c644222982..23e1cb016f 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -992,9 +992,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.28.gd7d8841f67
| [Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] vl: fix "type is NULL" in -vga help,
marcandre . lureau <=