mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-14 19:16:41 +07:00
powerpc/pseries: Use kmemdup
While looking at some code paths I came across this code that zeros memory then copies over the entire length. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
parent
45848e0fc1
commit
e72ed6b509
@ -55,13 +55,12 @@ static struct property *dlpar_parse_cc_property(struct cc_workarea *ccwa)
|
||||
|
||||
prop->length = ccwa->prop_length;
|
||||
value = (char *)ccwa + ccwa->prop_offset;
|
||||
prop->value = kzalloc(prop->length, GFP_KERNEL);
|
||||
prop->value = kmemdup(value, prop->length, GFP_KERNEL);
|
||||
if (!prop->value) {
|
||||
dlpar_free_cc_property(prop);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(prop->value, value, prop->length);
|
||||
return prop;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user