crypto: drivers - Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:27:08 +0000 (00:27 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 26 Jul 2019 05:03:59 +0000 (15:03 +1000)
commitcc2a58f14fb88e753fbc38b658e320c3a62d8c47
treee835794ef0fdf53b72e914da35c9fec6deffeede
parent97bcb161995548ad319c78b2533f998a7b92ab4c
crypto: drivers - Use kmemdup rather than duplicating its implementation

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@gmail.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caampkc.c
drivers/crypto/virtio/virtio_crypto_algs.c