summaryrefslogtreecommitdiff
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2018-04-23 12:54:56 +0300
committerThierry Reding <treding@nvidia.com>2018-05-17 18:44:48 +0300
commit27db6a0073f162cdb15975c9d29d159d772b1ec0 (patch)
tree7ebe1facb208007c3d34b703a2a1db1349c0bcd7 /drivers/gpu/host1x
parenta43d0a00ea58a665905d94e8ab469ff888b1b0e1 (diff)
downloadlinux-27db6a0073f162cdb15975c9d29d159d772b1ec0.tar.xz
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 <digetx@gmail.com> Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/cdma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c
index 28541b280739..cf6caa90bf89 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;
}