aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index f0eb3a7384..ee21d90e80 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -117,6 +117,9 @@ DeviceState *qdev_try_create(BusState *bus, const char *name)
{
DeviceState *dev;
+ if (object_class_by_name(name) == NULL) {
+ return NULL;
+ }
dev = DEVICE(object_new(name));
if (!dev) {
return NULL;