qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v1 2/3] object.c: object_class_dynamic_cast return N


From: Alistair Francis
Subject: [Qemu-devel] [PATCH v1 2/3] object.c: object_class_dynamic_cast return NULL if the class has no type
Date: Mon, 27 Jul 2015 11:37:46 -0700

If the ObjectClass has no type return NULL instead of trying to compare
the type name.

Signed-off-by: Alistair Francis <address@hidden>
Reviewed-by: Sai Pavan Boddu <address@hidden>
---
 qom/object.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/qom/object.c b/qom/object.c
index eea8edf..2d6d715 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -603,7 +603,7 @@ ObjectClass *object_class_dynamic_cast(ObjectClass *class,
     TypeImpl *target_type;
     TypeImpl *type;
 
-    if (!class) {
+    if (!class || !class->type) {
         return NULL;
     }
 
-- 
1.7.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]