mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 08:38:28 -04:00
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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
4671c204dd
commit
8d23ada8e7
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user