Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3528553pxb; Mon, 1 Mar 2021 12:23:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyu6kJiEHbd2ZEXgiaIF0faZHxj/uSMK+f2YYpxN/TwrEuRinvyrDkt905LwDE5Xb+UABlR X-Received: by 2002:a17:906:1759:: with SMTP id d25mr17665858eje.524.1614630215604; Mon, 01 Mar 2021 12:23:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614630215; cv=none; d=google.com; s=arc-20160816; b=Mrtm7jpobVjZCkzEfAiwSI0HRQlWsqRxkCtlC45KUGXS3Q3LmD1q9uWa7nD2rMLWow DPIqJEDOLcJp69+TTMLItVvq4yzaQe7AMrI2rF5Ea92rEGHuGtN4npDm6FiowkVj4mIE MEj7QeEa9YT0K0qumOeGo3Jib8c8D1qPyX+6znUjFvYTkH85BZ+aaeSoKrrJf1wlyy4B QkuWECkbePgzyKlJFn/iRiJPotgsnCOg+tSsj9exFtQ/B6ZKMhGTNzWp9nc+RB9Czuar ObZicsqlHm2Ub30SYSR2KCLqFFERYOD9upGE3Lybxn7fo1e5yRvo+4xbpLpw5Q9EAdaQ jjmw== 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=NJaM9VeaMIMrlF7rnQMnWAu97NRkKINZ0FRAOXw1/jU=; b=vfS9WIt7yyoTTQ0IeGWtau3chttzy03zho/a83X3q/UVG4n9hbZdmnBizgQI+4dUaw zRFIJ9wHZf9HyhuHs2h1ajxPr7vtm7xqCtHjvpAzjvMTxq+0OQTebEP9nhLMeoDyk55B i7eaN8soAxnOQB2oIrCGB/yZbaazevir6y9FVCb29zsYrXh6qgwBKzsAQcuXxHYLThVA xF3C9G16BrLMgHr4qhNZSvYBCLLkXh1kZf5ZDC/ovHWMLfp7Dpvh9f6QlZ77q6VLdCmI Jg5PUhKh4UuJLLkUPLszLhmIJT/5gNTm8srgBajHivMmDgJaiWG5CdeANdgexFQV/uOr +Q3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=KAts+U40; 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 zm17si12074525ejb.174.2021.03.01.12.23.13; Mon, 01 Mar 2021 12:23:35 -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=KAts+U40; 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 S243277AbhCAUTT (ORCPT + 99 others); Mon, 1 Mar 2021 15:19:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:35316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236629AbhCAREU (ORCPT ); Mon, 1 Mar 2021 12:04:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0AAB664F7A; Mon, 1 Mar 2021 16:39:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616758; bh=gscsK6egNxqXwp35awYMGStMGQWRsjreCV5Ex2pFbJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KAts+U40/ajRvIPwYVwzcHzq9PF1RaEQUdxvfuWJvFqixNzm8dg5tAJJY+KDCmJcc 9ZGQ+Nw37HlK2XCyOZL1jajPTVr6C1i981ylp3dKeL2I7F9bRMI8mOCKXtHJB78zlY lRVEu6hG4xfZ7weSRGTYqdHMNp4yhERlnbAw0kwY= 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 4.19 085/247] media: tm6000: Fix memleak in tm6000_start_stream Date: Mon, 1 Mar 2021 17:11:45 +0100 Message-Id: <20210301161035.839478721@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@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 3db2fd7f5d7c4..e4f2160f46ff1 100644 --- a/drivers/media/usb/tm6000/tm6000-dvb.c +++ b/drivers/media/usb/tm6000/tm6000-dvb.c @@ -149,6 +149,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 resetted\n"); -- 2.27.0