Skip to content

Commit

Permalink
iommu: Initialize domain->handler in iommu_domain_alloc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KyongHo Cho authored and Joerg Roedel committed Dec 16, 2011
1 parent b2c1639 commit 8bd6960
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
if (bus == NULL || bus->iommu_ops == NULL)
return NULL;

domain = kmalloc(sizeof(*domain), GFP_KERNEL);
domain = kzalloc(sizeof(*domain), GFP_KERNEL);
if (!domain)
return NULL;

Expand Down

0 comments on commit 8bd6960

Please sign in to comment.