diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2020-12-29 09:55:30 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-01-27 12:07:02 +0100 |
commit | 8d23ada8e72d460c24da50a008209ecd3d7f9c8b (patch) | |
tree | 5baf34afded9473be06fa8965cec81cd886a21db /drivers/media/test-drivers | |
parent | media: vidtv: remove unused field from 'struct vidtv_mpeg_ts' (diff) | |
download | linux-8d23ada8e72d460c24da50a008209ecd3d7f9c8b.tar.xz linux-8d23ada8e72d460c24da50a008209ecd3d7f9c8b.zip |
media: vidtv: Use kmemdup instead of kzalloc and memcpy
Fixes coccicheck warning:
drivers/media/test-drivers/vidtv/vidtv_psi.c:509:10-17: WARNING
opportunity for kmemdup
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers')
-rw-r--r-- | drivers/media/test-drivers/vidtv/vidtv_psi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c index 1724bb485e67..47ed7907db8d 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -506,10 +506,9 @@ struct vidtv_psi_desc *vidtv_psi_desc_clone(struct vidtv_psi_desc *desc) case REGISTRATION_DESCRIPTOR: default: - curr = kzalloc(sizeof(*desc) + desc->length, GFP_KERNEL); + curr = kmemdup(desc, sizeof(*desc) + desc->length, GFP_KERNEL); if (!curr) return NULL; - memcpy(curr, desc, sizeof(*desc) + desc->length); } if (!curr) |