From: Dmitry Osipenko Date: Mon, 23 Apr 2018 09:54:56 +0000 (+0300) Subject: gpu: host1x: Fix dma_free_wc() argument in the error path X-Git-Tag: v4.19~774^2~7^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27db6a0073f162cdb15975c9d29d159d772b1ec0;p=platform%2Fkernel%2Flinux-rpi.git gpu: host1x: Fix dma_free_wc() argument in the error path If IOVA allocation or IOMMU mapping fails, dma_free_wc() is invoked with size=0 because of a typo, that triggers "kernel BUG at mm/vmalloc.c:124!". Signed-off-by: Dmitry Osipenko Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding --- diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 28541b2..cf6caa9 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -127,7 +127,7 @@ static int host1x_pushbuffer_init(struct push_buffer *pb) iommu_free_iova: __free_iova(&host1x->iova, alloc); iommu_free_mem: - dma_free_wc(host1x->dev, pb->alloc_size, pb->mapped, pb->phys); + dma_free_wc(host1x->dev, size, pb->mapped, pb->phys); return err; }