提交 e72ed6b5 编写于 作者: N Nishanth Aravamudan 提交者: Benjamin Herrenschmidt

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: NMilton Miller <miltonm@bga.com>
Signed-off-by: NNishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 45848e0f
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册