hw/net/can: Fix segfaults when using the devices without bus
commit089eac81e1d34d202471c0a023284f47f4c5f00e
authorThomas Huth <thuth@redhat.com>
Fri, 16 Mar 2018 09:51:29 +0000 (16 10:51 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Mar 2018 12:37:13 +0000 (26 14:37 +0200)
tree005b5b335514a8b3ea2fa5256cf39aea562899cc
parent4e286099fee107d801f190145de54e47cc5bb3d2
hw/net/can: Fix segfaults when using the devices without bus

The CAN devices can currently be used to crash QEMU, e.g.:

$ x86_64-softmmu/qemu-system-x86_64 -device kvaser_pci
Segmentation fault (core dumped)

So we've got to add a proper check here that the corresponding
bus is available.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1521193892-15552-2-git-send-email-thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/net/can/can_sja1000.c