aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/can/can_host.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/can/can_host.c b/net/can/can_host.c
index be4547d913..ba7f163d0a 100644
--- a/net/can/can_host.c
+++ b/net/can/can_host.c
@@ -53,6 +53,11 @@ static void can_host_connect(CanHostState *ch, Error **errp)
CanHostClass *chc = CAN_HOST_GET_CLASS(ch);
Error *local_err = NULL;
+ if (ch->bus == NULL) {
+ error_setg(errp, "'canbus' property not set");
+ return;
+ }
+
chc->connect(ch, &local_err);
if (local_err) {
error_propagate(errp, local_err);