Return-Path: Received: from imap1.codethink.co.uk ([176.9.8.82]:35065 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751953AbeENRlR (ORCPT ); Mon, 14 May 2018 13:41:17 -0400 Message-ID: <1526319669.9159.20.camel@codethink.co.uk> Subject: Re: [PATCH 4.4 49/72] media: usbtv: prevent double free in error case From: Ben Hutchings To: Oliver Neukum , Hans Verkuil , Mauro Carvalho Chehab Cc: stable@vger.kernel.org, "Yavuz, Tuba" , Greg Kroah-Hartman , LKML Date: Mon, 14 May 2018 18:41:09 +0100 In-Reply-To: <20180406084309.317246829@linuxfoundation.org> References: <20180406084305.210085169@linuxfoundation.org> <20180406084309.317246829@linuxfoundation.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 > > 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.