Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp914794pxb; Wed, 3 Mar 2021 20:54:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzbkj8yOkVsPHrs0tDKDZdFDc3Qn6yk9hcw6zPZGlJBh599b4qi2w3XPODIOtL+wTy8Izeo X-Received: by 2002:a17:906:2755:: with SMTP id a21mr2270361ejd.374.1614833646243; Wed, 03 Mar 2021 20:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614833646; cv=none; d=google.com; s=arc-20160816; b=vRCR5Otk+Liw0DeYhUxVNsRqiKOfZ8p+klIDLZ8j4A5yfpRHWLRIkeZIi6UqWT9Naq rSLMF5o3/IpyR/D4Xqb44z55uDIqQnT4arA5mtF1Z061vI72Hh0UnNlTve5b96Cn6gPp iEuA0MR2Tvfyk1BYrgMQdRyGzwhQXL4oSFd/S7AvL0sXQpDRpwinooZhhgj8+u5F9SnY a+b3oXIQSDgERnTeTctnwxavS5iyM096IJyDhjzam71h7bT1xm6GkByV156LLmLSg/y0 DS0uwqOve/vCYe9immt3IjYz/mlQWLv+6ykMThVNkPnzi9RA7wVb+mYoofzmBQ+NbIuS DzMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TZsuVaiChWBN3ZyBWLP7tnHM6oeHmf+afOcjuPLNQCs=; b=UYzdIlMKfKPPLDHtgL4ITKuRKGIvB/Y1t+5xor/POqe6gAuGYpFtAhPX2Vw7fbOX7q FSPGv0+RMgDLXNm0NenMzuyWlQ45np/E87cgVlBP0Hn/5B71+W7VRFC00nHXUBG0Rfr+ wVVciH60dU8LLA8RlOg1QET1XZ/I3SukZQYCeFAMLx/NhGgNs7hc/jMRpe7eDRPvF6yk ft1sG9s9LKEUn4YDDckE/wt9YIVNsVzoJze1YqPJWklGRxKAHbDm9//lY5hvqGKJkrwT r7B9ZvJ+KrHAbMm1a/kfAW9YjeNMgXwew2DAVQRjZt+hwKgvYU8Lrf7ELdbGrJA8yFFZ r7jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D3j5PGm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p32si17440893edd.89.2021.03.03.20.53.43; Wed, 03 Mar 2021 20:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D3j5PGm4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442552AbhCBCOS (ORCPT + 99 others); Mon, 1 Mar 2021 21:14:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:53026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239017AbhCATlU (ORCPT ); Mon, 1 Mar 2021 14:41:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 680816519F; Mon, 1 Mar 2021 17:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618736; bh=2cCC6TH7qeRG0yCgcOb5UmMIhP5lGkq+1TM5FO9x5ek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D3j5PGm4k3Tn69l/HZMrlIZicQoi+GWneyQ62geTCZ6/SfO7vXkGW027rTZyjtrlN +dHQmA3eyzC2/0pa7aqS8WjY/B+nC0mk/AYAFXaS1pRp7HF4p3tfwkSgLl7DaL5reP omWTFLc+t7l3yc0qdgdHzrToOO4Azp3fxyAWN8ZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 168/663] media: tm6000: Fix memleak in tm6000_start_stream Date: Mon, 1 Mar 2021 17:06:56 +0100 Message-Id: <20210301161150.095152274@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dinghao Liu [ Upstream commit 76aaf8a96771c16365b8510f1fb97738dc88026e ] When usb_clear_halt() fails, dvb->bulk_urb->transfer_buffer and dvb->bulk_urb should be freed just like when usb_submit_urb() fails. Fixes: 3169c9b26fffa ("V4L/DVB (12788): tm6000: Add initial DVB-T support") Signed-off-by: Dinghao Liu Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/tm6000/tm6000-dvb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/usb/tm6000/tm6000-dvb.c b/drivers/media/usb/tm6000/tm6000-dvb.c index 19c90fa9e443d..293a460f4616c 100644 --- a/drivers/media/usb/tm6000/tm6000-dvb.c +++ b/drivers/media/usb/tm6000/tm6000-dvb.c @@ -141,6 +141,10 @@ static int tm6000_start_stream(struct tm6000_core *dev) if (ret < 0) { printk(KERN_ERR "tm6000: error %i in %s during pipe reset\n", ret, __func__); + + kfree(dvb->bulk_urb->transfer_buffer); + usb_free_urb(dvb->bulk_urb); + dvb->bulk_urb = NULL; return ret; } else printk(KERN_ERR "tm6000: pipe reset\n"); -- 2.27.0