Skip to content

Commit

Permalink
iommu/vt-d: Zero out allocated memory in dmar_enable_qi
Browse files Browse the repository at this point in the history
kmemcheck complained about the use of uninitialized memory.
Fix by using kzalloc instead of kmalloc.

Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Joerg Roedel <joro@8bytes.org>
  • Loading branch information
Hannes Reinecke authored and Joerg Roedel committed Feb 7, 2013
1 parent 88b62b9 commit 37a4071
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/dmar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 37a4071

Please sign in to comment.