vdpa_sim: init iommu lock
authorMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Aug 2020 12:44:43 +0000 (08:44 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 10 Aug 2020 12:44:47 +0000 (08:44 -0400)
The patch adding the iommu lock did not initialize it.
The struct is zero-initialized so this is mostly a problem
when using lockdep.

Reported-by: kernel test robot <rong.a.chen@intel.com>
Cc: Max Gurtovoy <maxg@mellanox.com>
Fixes: 0ea9ee430e74 ("vdpasim: protect concurrent access to iommu iotlb")
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vdpa/vdpa_sim/vdpa_sim.c

index df3224b138ee0c0085979ede476dfd281f83be93..604d9d25ca47f42fd261362f1e2b365b08189377 100644 (file)
@@ -358,6 +358,7 @@ static struct vdpasim *vdpasim_create(void)
 
        INIT_WORK(&vdpasim->work, vdpasim_work);
        spin_lock_init(&vdpasim->lock);
+       spin_lock_init(&vdpasim->iommu_lock);
 
        dev = &vdpasim->vdpa.dev;
        dev->coherent_dma_mask = DMA_BIT_MASK(64);