mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 01:51:18 +00:00
powerpc/pseries: replace kmalloc with kzalloc in PLPKS driver
[ Upstream commit212dd5cfbe
] Replace kmalloc with kzalloc in construct_auth() function to default initialize structure with zeroes. Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20221106205839.600442-6-nayna@linux.ibm.com Stable-dep-of:784354349d
("powerpc/pseries: make max polling consistent for longer H_CALLs") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
70f64cb290
commit
5aa59e14ec
1 changed files with 2 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
memcpy(auth->password, ospassword, ospasswordlength);
|
||||
|
||||
|
|
Loading…
Reference in a new issue