diff options
author | Nishanth Aravamudan <nacc@us.ibm.com> | 2010-09-15 08:05:49 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-10-13 16:19:22 +1100 |
commit | e72ed6b509a62605fe9aca195c6037abdda6c1ac (patch) | |
tree | fe5d88cc52ba4df1a323bc575677f6a33785614c | |
parent | 45848e0fc1fce399651b3f480bdeb82cc6d3d15a (diff) | |
download | kernel_samsung_espresso10-e72ed6b509a62605fe9aca195c6037abdda6c1ac.zip kernel_samsung_espresso10-e72ed6b509a62605fe9aca195c6037abdda6c1ac.tar.gz kernel_samsung_espresso10-e72ed6b509a62605fe9aca195c6037abdda6c1ac.tar.bz2 |
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>
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 75d336a..b74a923 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c @@ -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; } |