iommu.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iommu/amd: Argument page_size could be uninitialized
@ 2018-06-01 18:30 yzhai003
  2018-07-06 11:18 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: yzhai003 @ 2018-06-01 18:30 UTC (permalink / raw)
  To: Joerg Roedel, iommu, linux-kernel; +Cc: yzhai003, csong, zhiyunq

Argument "page_size" passing to function "fetch_pte" could be
uninitialized if the function returns NULL

The caller "iommu_unmap_page" checks the return value but the page_size is
used outside the if block.

Signed-off-by: yzhai003@ucr.edu <yzhai003@ucr.edu>
---
 drivers/iommu/amd_iommu.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8fb8c73..7c15eaf 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -1398,6 +1398,8 @@ static u64 *fetch_pte(struct protection_domain *domain,
 	int level;
 	u64 *pte;
 
+	*page_size = 0;
+
 	if (address > PM_LEVEL_SIZE(domain->mode))
 		return NULL;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iommu/amd: Argument page_size could be uninitialized
  2018-06-01 18:30 [PATCH] iommu/amd: Argument page_size could be uninitialized yzhai003
@ 2018-07-06 11:18 ` Joerg Roedel
  0 siblings, 0 replies; 2+ messages in thread
From: Joerg Roedel @ 2018-07-06 11:18 UTC (permalink / raw)
  To: yzhai003@ucr.edu; +Cc: iommu, linux-kernel, csong, zhiyunq

On Fri, Jun 01, 2018 at 11:30:14AM -0700, yzhai003@ucr.edu wrote:
> Argument "page_size" passing to function "fetch_pte" could be
> uninitialized if the function returns NULL
> 
> The caller "iommu_unmap_page" checks the return value but the page_size is
> used outside the if block.
> 
> Signed-off-by: yzhai003@ucr.edu <yzhai003@ucr.edu>
> ---
>  drivers/iommu/amd_iommu.c | 2 ++
>  1 file changed, 2 insertions(+)

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-06 11:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-01 18:30 [PATCH] iommu/amd: Argument page_size could be uninitialized yzhai003
2018-07-06 11:18 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).