lkml.org 
[lkml]   [2018]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 4.4 49/72] media: usbtv: prevent double free in error case
From
Date
On Fri, 2018-04-06 at 15:23 +0200, Greg Kroah-Hartman wrote:
> 4.4-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Oliver Neukum <oneukum@suse.com>
>
> commit 50e7044535537b2a54c7ab798cd34c7f6d900bd2 upstream.
[...]
> --- a/drivers/media/usb/usbtv/usbtv-core.c
> +++ b/drivers/media/usb/usbtv/usbtv-core.c
> @@ -95,6 +95,8 @@ static int usbtv_probe(struct usb_interf
> >   return 0;
>  
>  usbtv_audio_fail:
> + /* we must not free at this point */
> + usb_get_dev(usbtv->udev);

Shouldn't this bump the V4L2 device's reference count, i.e.:

v4l2_device_get(&usbtv->v4l2_dev);

?

Ben.

>   usbtv_video_free(usbtv);
>  
>  usbtv_video_fail:
>
>
>
--
Ben Hutchings
Software Developer, Codethink Ltd.

\
 
 \ /
  Last update: 2018-05-14 19:41    [W:0.209 / U:2.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site