lkml.org 
[lkml]   [2021]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v10 13/21] media: uvcvideo: Use control names from framework
Em Fri, 18 Jun 2021 14:29:15 +0200
Ricardo Ribalda <ribalda@chromium.org> escreveu:

> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> index 9cdd30eff495..28ccaa8b9e42 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -40,7 +40,13 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
> return -ENOMEM;
>
> map->id = xmap->id;
> - memcpy(map->name, xmap->name, sizeof(map->name));
> + /* Non standard control id. */
> + if (v4l2_ctrl_get_name(map->id) == NULL) {
> + map->name = kmemdup(xmap->name, sizeof(xmap->name),
> + GFP_KERNEL);

Where are you de-allocating it at driver removal/unbind?

Thanks,
Mauro

\
 
 \ /
  Last update: 2021-09-03 12:13    [W:0.169 / U:0.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site