linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  x86/mm/mem_encrypt_identity : fix error useage to sizeof
@ 2018-12-29  6:34 Peng Hao
  2018-12-29  8:00 ` Borislav Petkov
  2019-01-15 10:45 ` [tip:x86/urgent] x86/mm/mem_encrypt: Fix erroneous sizeof() tip-bot for Peng Hao
  0 siblings, 2 replies; 7+ messages in thread
From: Peng Hao @ 2018-12-29  6:34 UTC (permalink / raw)
  To: dave.hansen, peterz, tglx, luto; +Cc: x86, linux-kernel, Peng Hao

Fix error usage to sizeof. It should not use sizeof to pointer.

Signed-off-by: Peng Hao <peng.hao2@zte.com.cn>
---
 arch/x86/mm/mem_encrypt_identity.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c
index a19ef1a..4aa9b14 100644
--- a/arch/x86/mm/mem_encrypt_identity.c
+++ b/arch/x86/mm/mem_encrypt_identity.c
@@ -158,8 +158,8 @@ static void __init sme_populate_pgd(struct sme_populate_pgd_data *ppd)
 	pmd = pmd_offset(pud, ppd->vaddr);
 	if (pmd_none(*pmd)) {
 		pte = ppd->pgtable_area;
-		memset(pte, 0, sizeof(pte) * PTRS_PER_PTE);
-		ppd->pgtable_area += sizeof(pte) * PTRS_PER_PTE;
+		memset(pte, 0, sizeof(*pte) * PTRS_PER_PTE);
+		ppd->pgtable_area += sizeof(*pte) * PTRS_PER_PTE;
 		set_pmd(pmd, __pmd(PMD_FLAGS | __pa(pte)));
 	}
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread
[parent not found: <201901071946365174691@zte.com.cn>]

end of thread, other threads:[~2019-01-15 10:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-29  6:34 [PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof Peng Hao
2018-12-29  8:00 ` Borislav Petkov
2019-01-15 10:45 ` [tip:x86/urgent] x86/mm/mem_encrypt: Fix erroneous sizeof() tip-bot for Peng Hao
     [not found] <201901071946365174691@zte.com.cn>
2019-01-15 10:13 ` Re:[PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof Thomas Gleixner
2019-01-15 10:21   ` [PATCH] " Juergen Gross
2019-01-15 10:25     ` Thomas Gleixner
2019-01-15 10:35       ` Juergen Gross
2019-01-15 10:35       ` Thomas Gleixner

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).