Re: [PATCH] iommu/virtio: reverse arguments to list_add
On Tue, May 05, 2020 at 08:47:47PM +0200, Julia Lawall wrote: > Elsewhere in the file, there is a list_for_each_entry with > >resv_regions as the second argument, suggesting that > >resv_regions is the list head. So exchange the > arguments on the list_add call to put the list head in the > second argument. > > Fixes: 2a5a31487445 ("iommu/virtio: Add probe request") > Signed-off-by: Julia Lawall Applied for v5.7, thanks. ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
Re: [PATCH] iommu/virtio: reverse arguments to list_add
On Tue, May 05, 2020 at 08:47:47PM +0200, Julia Lawall wrote: > Elsewhere in the file, there is a list_for_each_entry with > >resv_regions as the second argument, suggesting that > >resv_regions is the list head. So exchange the > arguments on the list_add call to put the list head in the > second argument. > > Fixes: 2a5a31487445 ("iommu/virtio: Add probe request") > Signed-off-by: Julia Lawall Thanks for the fix. The reason this hasn't blown up so far is iommu_alloc_resv_region() initializes region->list, but adding more than one item would break the list. Reviewed-by: Jean-Philippe Brucker > --- > drivers/iommu/virtio-iommu.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c > index d5cac4f46ca5..4e1d11af23c8 100644 > --- a/drivers/iommu/virtio-iommu.c > +++ b/drivers/iommu/virtio-iommu.c > @@ -453,7 +453,7 @@ static int viommu_add_resv_mem(struct viommu_endpoint > *vdev, > if (!region) > return -ENOMEM; > > - list_add(>resv_regions, >list); > + list_add(>list, >resv_regions); > return 0; > } > > ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
[PATCH] iommu/virtio: reverse arguments to list_add
Elsewhere in the file, there is a list_for_each_entry with >resv_regions as the second argument, suggesting that >resv_regions is the list head. So exchange the arguments on the list_add call to put the list head in the second argument. Fixes: 2a5a31487445 ("iommu/virtio: Add probe request") Signed-off-by: Julia Lawall --- drivers/iommu/virtio-iommu.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index d5cac4f46ca5..4e1d11af23c8 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -453,7 +453,7 @@ static int viommu_add_resv_mem(struct viommu_endpoint *vdev, if (!region) return -ENOMEM; - list_add(>resv_regions, >list); + list_add(>list, >resv_regions); return 0; } ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu