From: Hannes Reinecke Date: Wed, 6 Feb 2013 08:50:10 +0000 (+0100) Subject: iommu/vt-d: Zero out allocated memory in dmar_enable_qi X-Git-Tag: v3.9-rc1~73^2^7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37a407101e08e444a193837a1e1d4f6f66c8dad4;p=profile%2Fivi%2Fkernel-x86-ivi.git iommu/vt-d: Zero out allocated memory in dmar_enable_qi kmemcheck complained about the use of uninitialized memory. Fix by using kzalloc instead of kmalloc. Cc: David Woodhouse Signed-off-by: Hannes Reinecke Signed-off-by: Joerg Roedel --- diff --git a/drivers/iommu/dmar.c b/drivers/iommu/dmar.c index 86e2f4a..2623a57 100644 --- a/drivers/iommu/dmar.c +++ b/drivers/iommu/dmar.c @@ -1040,7 +1040,7 @@ int dmar_enable_qi(struct intel_iommu *iommu) qi->desc = page_address(desc_page); - qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC); + qi->desc_status = kzalloc(QI_LENGTH * sizeof(int), GFP_ATOMIC); if (!qi->desc_status) { free_page((unsigned long) qi->desc); kfree(qi);