File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1686,8 +1686,9 @@ int vhost_dev_start(struct vhost_dev *hdev, VirtIODevice *vdev)
1686
1686
}
1687
1687
}
1688
1688
1689
- if (vhost_dev_has_iommu (hdev )) {
1690
- hdev -> vhost_ops -> vhost_set_iotlb_callback (hdev , true);
1689
+ if (vhost_dev_has_iommu (hdev ) &&
1690
+ hdev -> vhost_ops -> vhost_set_iotlb_callback ) {
1691
+ hdev -> vhost_ops -> vhost_set_iotlb_callback (hdev , true);
1691
1692
1692
1693
/* Update used ring information for IOTLB to work correctly,
1693
1694
* vhost-kernel code requires for this.*/
@@ -1730,7 +1731,9 @@ void vhost_dev_stop(struct vhost_dev *hdev, VirtIODevice *vdev)
1730
1731
}
1731
1732
1732
1733
if (vhost_dev_has_iommu (hdev )) {
1733
- hdev -> vhost_ops -> vhost_set_iotlb_callback (hdev , false);
1734
+ if (hdev -> vhost_ops -> vhost_set_iotlb_callback ) {
1735
+ hdev -> vhost_ops -> vhost_set_iotlb_callback (hdev , false);
1736
+ }
1734
1737
memory_listener_unregister (& hdev -> iommu_listener );
1735
1738
}
1736
1739
vhost_log_put (hdev , true);
You can’t perform that action at this time.
0 commit comments