media: media/usb: Use kmemdup rather than duplicating its implementation
authorFuqian Huang <huangfq.daxian@gmail.com>
Wed, 3 Jul 2019 16:28:57 +0000 (13:28 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 14 Aug 2019 08:02:43 +0000 (05:02 -0300)
commit771560e5d341dc61f9e87bc715f3dbb4efe6ec62
treefb069729ba7d19bb18365657e640d40d9cbb9a33
parent0dc99e042a4cfbc1e27572d523d2a1dbaf402cbf
media: media/usb: 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>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/usb/em28xx/em28xx-cards.c
drivers/media/usb/zr364xx/zr364xx.c