Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1121550pxx; Tue, 27 Oct 2020 08:44:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+iOVAXBVnLrxPA2QRnag5xhmIkd3Aco4ODYisBkNplRVLPTyf/ZyhMX2DKYdIWNM3Zg5H X-Received: by 2002:a05:6402:1c10:: with SMTP id ck16mr2960271edb.7.1603813477762; Tue, 27 Oct 2020 08:44:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603813477; cv=none; d=google.com; s=arc-20160816; b=icW+al8D76pt/c1c8tTVRgToXZsC5uh5ZOJAwVcrNx8vnv4dBPew1CIvC9Xbxgrjwh nep/DwVODNdcLdld78Uqwrz5OLXGLr3GYfcI7PKndxt7462NT/DLY6ME+mj03D2vx3nE PutGuQB4Xa0AdOMs5Ky9fXsp0EgMpeRSUMO/4IiFaQTpINLu4iuSPILcej5ifYgXCEe4 yWy51/cKV25wfw346L/XBrss8jiUebN88BmxOx2OJ/bI6Qu4qwdin5xT+v9CwP0zx9IR czGhqaPiBZvekPjpQuPrcPDP7/Qdbl4gRqQamK5AGLU2yiWD14nl/TVxZ7kwi+DUTV4f yOZw== 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=c8AtJsxyawEvk2Ly92+oWEuiMaZd/LUI47yItF9Rtz4=; b=VnKQANtQki4y7Ie5lqiYyg7tZtiG1s/orLIZtDj/T+PF0OxUv5/CP6M/6w6DKZD76Q hx830Za/x5sm1FyjMewt3RJMGEzo3ULGS2ErlEcePVQafUnjV2If7nrIdgFxKyYdv0Vk r9Xd7b3GVewQHBF3Ag1ZkbegkC8iY3/ew3ZPmf7GlhCwdLL5rexwr+LqUO2I+qaQ6Xe+ dzBDxsNYPM6l5e6Bo3mwwKvN3o+nTLENfYAj10cEtullknIXsiIG+E3AbK1awwj1WM7+ 02X97/pB2AG47vWXWFIZyL1/aWePR49Qbhz/dvC511FoU8mBC6jmQ0+TS99i0Qt9/DOE gezQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vrp2ejEY; 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=fail (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 f5si1196020edt.266.2020.10.27.08.44.15; Tue, 27 Oct 2020 08:44:37 -0700 (PDT) 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=@kernel.org header.s=default header.b=Vrp2ejEY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1766242AbgJ0Orq (ORCPT + 99 others); Tue, 27 Oct 2020 10:47:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:47526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1765016AbgJ0Orh (ORCPT ); Tue, 27 Oct 2020 10:47:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B0507206E5; Tue, 27 Oct 2020 14:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810057; bh=zx84Ap/ZbXLfmgQQFnACS6AemwwsovoRyJHPi1w2D2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vrp2ejEYWkY+tF8Sce408jlZ7dCCAjDdk0jXjGWBl7LL0PVDeW1xQnS2Ev7vai7Xd u7tFjRNmpFP1Q/TToxGY+yWhWGnOnrGb3SDWPjSyikT7MrLKz7AGd6uLkZSR8zKKYu Tckwlq7q6LefhmWS+yXhOpmzqZhkG+UqP5FAlgJE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.4 387/408] Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb Date: Tue, 27 Oct 2020 14:55:25 +0100 Message-Id: <20201027135512.947356868@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 d33fe77bdf75806d785dabf90d21d962122e5296 ] When kmalloc() on buf fails, urb should be freed just like when kmalloc() on dr fails. Signed-off-by: Dinghao Liu Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index f3f0529564da0..b326eeddaadf0 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2664,6 +2664,7 @@ static int btusb_mtk_submit_wmt_recv_urb(struct hci_dev *hdev) buf = kmalloc(size, GFP_KERNEL); if (!buf) { kfree(dr); + usb_free_urb(urb); return -ENOMEM; } -- 2.25.1