UPSTREAM: iommu/rockchip: Fix allocation of bases array in driver probe
authorShunqian Zheng <zhengsq@rock-chips.com>
Fri, 24 Jun 2016 02:13:28 +0000 (10:13 +0800)
committerJeffy Chen <jeffy.chen@rock-chips.com>
Mon, 28 Nov 2016 12:42:24 +0000 (20:42 +0800)
commit4ba9328836ff43c11aa89d5308f24607a7a191c9
treecb452f98c3c3e83676f7395ca62b2499671a2e38
parent2c0c5d4368414c16f1ed2823b9b6fe15d0f979be
UPSTREAM: iommu/rockchip: Fix allocation of bases array in driver probe

In .probe(), devm_kzalloc() is called with size == 0 and works only
by luck, due to internal behavior of the allocator and the fact
that the proper allocation size is small. Let's use proper value for
calculating the size.

Fixes: cd6438c5f844 ("iommu/rockchip: Reconstruct to support multi slaves")
Signed-off-by: Shunqian Zheng <zhengsq@rock-chips.com>
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
(cherry picked from commit 3d08f434bd58656ae630376d0b5afd6ca1ffb013)

Change-Id: I78db8fbf3cb781745a05f8bee492dd7e8ac784c5
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
drivers/iommu/rockchip-iommu.c