From: Peng Hao <peng.hao2@zte.com.cn>
To: dave.hansen@linux.intel.com, peterz@infradead.org,
tglx@linutronix.de, luto@kernel.org
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Peng Hao <peng.hao2@zte.com.cn>
Subject: [PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof
Date: Sat, 29 Dec 2018 14:34:12 +0800 [thread overview]
Message-ID: <1546065252-97996-1-git-send-email-peng.hao2@zte.com.cn> (raw)
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
next reply other threads:[~2018-12-29 6:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-29 6:34 Peng Hao [this message]
2018-12-29 8:00 ` [PATCH] x86/mm/mem_encrypt_identity : fix error useage to sizeof 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1546065252-97996-1-git-send-email-peng.hao2@zte.com.cn \
--to=peng.hao2@zte.com.cn \
--cc=dave.hansen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).