diff --git a/drivers/virtio/virtio_dma_buf.c b/drivers/virtio/virtio_dma_buf.c index 5127a2f0c986..f94ab97d49b6 100644 --- a/drivers/virtio/virtio_dma_buf.c +++ b/drivers/virtio/virtio_dma_buf.c @@ -25,11 +25,14 @@ struct dma_buf *virtio_dma_buf_export const struct virtio_dma_buf_ops, ops); if (!exp_info->ops || - exp_info->ops->attach != &virtio_dma_buf_attach || !virtio_ops->get_uuid) { return ERR_PTR(-EINVAL); } + if (!(IS_ENABLED(CONFIG_CFI_CLANG) && IS_ENABLED(CONFIG_MODULES)) && + exp_info->ops->attach != &virtio_dma_buf_attach) + return ERR_PTR(-EINVAL); + return dma_buf_export(exp_info); } EXPORT_SYMBOL(virtio_dma_buf_export); @@ -60,6 +63,9 @@ EXPORT_SYMBOL(virtio_dma_buf_attach); */ bool is_virtio_dma_buf(struct dma_buf *dma_buf) { + if (IS_ENABLED(CONFIG_CFI_CLANG) && IS_ENABLED(CONFIG_MODULES)) + return true; + return dma_buf->ops->attach == &virtio_dma_buf_attach; } EXPORT_SYMBOL(is_virtio_dma_buf);