]> git.proxmox.com Git - qemu.git/commit
qom/object: Don't poll cast cache for NULL objects
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Wed, 22 May 2013 01:19:16 +0000 (11:19 +1000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 11 Jun 2013 21:47:52 +0000 (16:47 -0500)
commit3541912190ab24dac4b8e4edc41570b5ca1906e5
treec9e5973bfc7d86f515f396fa19e28274ecf107a5
parent749806d1a741d23181e5c8f807c411868384b122
qom/object: Don't poll cast cache for NULL objects

object_dynamic_cast_assert used to be tolerant of NULL objects and not
assert. It's clear from the implementation that this is the expected
behavior.

The preceding check of the cast cache dereferences obj however causing
a segfault. Fix by conditionalizing the cast cache logic on obj being
non-null.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Message-id: 8e2bef6a55753869c50bfa32226f7fcf0439ca62.1369183592.git.peter.crosthwaite@xilinx.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 95916abcf428fb03644468c7fbce64356c6483c0)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qom/object.c