From: Andrew Donnellan <ajd@linux.ibm.com>
To: Nayna Jain <nayna@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Cc: gjoyce@linux.vnet.ibm.com, npiggin@gmail.com,
George Wilson <gcwilson@linux.ibm.com>,
bjking1@us.ibmcom
Subject: Re: [PATCH 5/6] powerpc/pseries: replace kmalloc with kzalloc in PLPKS driver
Date: Fri, 25 Nov 2022 14:31:33 +1100 [thread overview]
Message-ID: <4a247c2e9e9da0726a9890648c0e25cd2f9a3c89.camel@linux.ibm.com> (raw)
In-Reply-To: <20221106205839.600442-6-nayna@linux.ibm.com>
On Sun, 2022-11-06 at 15:58 -0500, Nayna Jain wrote:
> Replace kmalloc with kzalloc in construct_auth() function to default
> initialize structure with zeroes.
>
> Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
This seems sensible.
> ---
> arch/powerpc/platforms/pseries/plpks.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/plpks.c
> b/arch/powerpc/platforms/pseries/plpks.c
> index 72d9debf18c0..e8c02735b702 100644
> --- a/arch/powerpc/platforms/pseries/plpks.c
> +++ b/arch/powerpc/platforms/pseries/plpks.c
> @@ -162,19 +162,15 @@ static struct plpks_auth *construct_auth(u8
> consumer)
> if (consumer > PKS_OS_OWNER)
> return ERR_PTR(-EINVAL);
>
> - auth = kmalloc(struct_size(auth, password, maxpwsize),
> GFP_KERNEL);
> + auth = kzalloc(struct_size(auth, password, maxpwsize),
> GFP_KERNEL);
> if (!auth)
> return ERR_PTR(-ENOMEM);
>
> auth->version = 1;
> auth->consumer = consumer;
> - auth->rsvd0 = 0;
> - auth->rsvd1 = 0;
>
> - if (consumer == PKS_FW_OWNER || consumer ==
> PKS_BOOTLOADER_OWNER) {
> - auth->passwordlength = 0;
> + if (consumer == PKS_FW_OWNER || consumer ==
> PKS_BOOTLOADER_OWNER)
> return auth;
> - }
This bit seems spurious.
>
> memcpy(auth->password, ospassword, ospasswordlength);
>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
next prev parent reply other threads:[~2022-11-25 3:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-06 20:58 [PATCH 0/6] powerpc/pseries - bugfixes/cleanups for PLPKS driver Nayna Jain
2022-11-06 20:58 ` [PATCH 1/6] powerpc/pseries: fix the object owners enum value in plpks driver Nayna Jain
2022-11-25 3:54 ` Andrew Donnellan
2022-11-06 20:58 ` [PATCH 2/6] powerpc/pseries: Fix the H_CALL error code in PLPKS driver Nayna Jain
2022-11-25 5:17 ` Andrew Donnellan
2022-11-06 20:58 ` [PATCH 3/6] powerpc/pseries: Return -EIO instead of -EINTR for H_ABORTED error Nayna Jain
2022-11-30 2:55 ` Andrew Donnellan
2022-11-06 20:58 ` [PATCH 4/6] powerpc/pseries: cleanup error logs in plpks driver Nayna Jain
2022-11-06 20:58 ` [PATCH 5/6] powerpc/pseries: replace kmalloc with kzalloc in PLPKS driver Nayna Jain
2022-11-25 3:31 ` Andrew Donnellan [this message]
2022-11-06 20:58 ` [PATCH 6/6] powerpc/pseries: fix plpks_read_var() code for different consumers Nayna Jain
2022-11-30 9:24 ` [PATCH 0/6] powerpc/pseries - bugfixes/cleanups for PLPKS driver Michael Ellerman
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=4a247c2e9e9da0726a9890648c0e25cd2f9a3c89.camel@linux.ibm.com \
--to=ajd@linux.ibm.com \
--cc=bjking1@us.ibmcom \
--cc=gcwilson@linux.ibm.com \
--cc=gjoyce@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=nayna@linux.ibm.com \
--cc=npiggin@gmail.com \
/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).