Re: [PATCH v2 06/35] crypto: Use kmemdup rather than duplicating its implementation

From: Horia Geanta
Date: Wed Jul 03 2019 - 13:10:33 EST


On 7/3/2019 7:27 PM, Fuqian Huang wrote:
> kmemdup is introduced to duplicate a region of memory in a neat way.
> Rather than kmalloc/kzalloc + memcpy, which the programmer needs to
> write the size twice (sometimes lead to mistakes), kmemdup improves
> readability, leads to smaller code and also reduce the chances of mistakes.
> Suggestion to use kmemdup rather than using kmalloc/kzalloc + memcpy.
>
> Signed-off-by: Fuqian Huang <huangfq.daxian@xxxxxxxxx>
Reviewed-by: Horia Geantă <horia.geanta@xxxxxxx>

Thanks,
Horia