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:
Nishanth Aravamudan 2010-09-15 08:05:49 +00:00 committed by Benjamin Herrenschmidt
parent 45848e0fc1
commit e72ed6b509

View File

@ -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;
}