Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iommu: Initialize domain->handler in iommu_domain_alloc()

Since it is not guaranteed that an iommu driver initializes in its
domain_init() function, it must be initialized with NULL to prevent
calling a function in an arbitrary location when iommu fault occurred.

Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>

authored by

KyongHo Cho and committed by
Joerg Roedel
8bd6960c b2c16391

+1 -1
+1 -1
drivers/iommu/iommu.c
··· 90 90 if (bus == NULL || bus->iommu_ops == NULL) 91 91 return NULL; 92 92 93 - domain = kmalloc(sizeof(*domain), GFP_KERNEL); 93 + domain = kzalloc(sizeof(*domain), GFP_KERNEL); 94 94 if (!domain) 95 95 return NULL; 96 96