iommu/exynos: zero initialization for region structure
authorJanghyuck Kim <janghyuck.kim@samsung.com>
Wed, 9 Aug 2017 05:56:52 +0000 (14:56 +0900)
committerEunyoung Lee <ey470.lee@samsung.com>
Wed, 20 Jun 2018 00:17:44 +0000 (09:17 +0900)
To avoid reference the uninitialized variable in region structure,
kmalloc is replaced with kzalloc.

Change-Id: I9430d05b912e97521694516548e5cca61d4a40bf
Signed-off-by: Janghyuck Kim <janghyuck.kim@samsung.com>
Signed-off-by: ChiHun Won <chihun.won@samsung.com>
drivers/iommu/exynos-iovmm.c

index 07c449f4fe633c6823cd479151d5c8daa389496c..5fde22ac2788f71634bac9113b203c2a03c5438c 100644 (file)
@@ -188,7 +188,7 @@ static dma_addr_t add_iovm_region(struct exynos_iovmm *vmm,
 {
        struct exynos_vm_region *region, *pos;
 
-       region = kmalloc(sizeof(*region), GFP_KERNEL);
+       region = kzalloc(sizeof(*region), GFP_KERNEL);
        if (!region)
                return 0;