projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cafd254
)
amd_iommu: do not dereference a NULL pointer address.
author
Maurizio Lombardi
<mlombard@redhat.com>
Thu, 11 Sep 2014 10:28:03 +0000
(12:28 +0200)
committer
Joerg Roedel
<jroedel@suse.de>
Thu, 25 Sep 2014 13:58:42 +0000
(15:58 +0200)
under low memory conditions, alloc_pte() may return a NULL pointer.
iommu_map_page() does not check it and will panic the system.
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/amd_iommu.c
patch
|
blob
|
history
diff --git
a/drivers/iommu/amd_iommu.c
b/drivers/iommu/amd_iommu.c
index 989c1ae039795aeb2bec7d5260ad710d85fcfb06..23c5be6a3a1ebe73cbacd569ea480f3a7c874b0a 100644
(file)
--- a/
drivers/iommu/amd_iommu.c
+++ b/
drivers/iommu/amd_iommu.c
@@
-1393,6
+1393,9
@@
static int iommu_map_page(struct protection_domain *dom,
count = PAGE_SIZE_PTE_COUNT(page_size);
pte = alloc_pte(dom, bus_addr, page_size, NULL, GFP_KERNEL);
+ if (!pte)
+ return -ENOMEM;
+
for (i = 0; i < count; ++i)
if (IOMMU_PTE_PRESENT(pte[i]))
return -EBUSY;