Message ID | 1496328687-13121-1-git-send-email-indiffPig@126.com |
---|---|
State | New |
Headers | show |
diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index dde094a..3a9fdf4 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -387,6 +387,9 @@ static int vhost_user_set_vring_base(struct vhost_dev *dev, static int vhost_user_set_vring_enable(struct vhost_dev *dev, int enable) { int i; + if (!dev) { + return -1; + } if (!virtio_has_feature(dev->features, VHOST_USER_F_PROTOCOL_FEATURES)) { return -1;