Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp301009pxx; Wed, 28 Oct 2020 05:23:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx635yDrAX90DuwcXzrcn0YGuMcxEniEcOgaY5JhODqZ20x8+j1+HcnukP+8iaBP+xP+gMy X-Received: by 2002:a17:906:3c03:: with SMTP id h3mr7086390ejg.78.1603887785903; Wed, 28 Oct 2020 05:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603887785; cv=none; d=google.com; s=arc-20160816; b=a/dLQPPVy/fbw2yeKo+YbClChCaP6KhHgKxO26On7zLk+f2ElNfW/Ru3jS0wbtSmki 3/UiV+WzQuhsfHa8/bGlMJKB1jxhYxwtQs0owR5jOCgcj9s/zw0dCmLP2Lbim6sVecID +8ntOedI5pBCmcyArO68QwtjGnedIa+avqcKf5KugEn87xtSZEPmkRBE6OFBKK9/6X4O DG/XjRjpHsKQV6sFaeczOkRtcoB5bz2ctDTiUSS/bcUkGLyzAmBvCG5gnDEsLKkjQRiO C9j+5MbsM5czFEcq/eTyxNVBMwbCU76KJ/nWXJrzGxn/lThyhEDlwpJVk9WHETDD5IhB emMw== 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=72fj/Sz3esxxAxeJLE4e38ukDiXvi6WKZ/tmQuozPNA=; b=Niz2KP/sPAqotxFWjsnXRXUKr+81itTl3+4QyMNYxWiIguiuBoRLAanq5hfWtdzymB ByzcamdcBOA9wNdVBdsLhPPzelpGXKGsRgoEkjK9SVs4rI+UevDw+Ed3or+3mpdxGlFf xfr6I+C9TcVZM/6b7gMu8sIo5W/tLFCWsNp0x0oz9PotfJ4ZnudvfkquNYWS2kO89YJR MaAEdj/CxHjVY3dTvlwBP2vznlZKWdLuRmnmgKZCgOuUSHoaAZbwgDIQ8s63J4iL4m6H /v4XDzg0q48RMk2H2KXqGTpm4AFmJABFTbRIgaHLccmK6GmfWI4TYDKJ5/p/sTS4K1A/ sqTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=t48qxLaC; 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 s16si2897729edy.300.2020.10.28.05.22.44; Wed, 28 Oct 2020 05:23:05 -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=t48qxLaC; 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 S1796754AbgJ0PTv (ORCPT + 99 others); Tue, 27 Oct 2020 11:19:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:52702 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796194AbgJ0PQB (ORCPT ); Tue, 27 Oct 2020 11:16:01 -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 EE6F52224A; Tue, 27 Oct 2020 15:16:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811761; bh=fLiAoAGyPCd7f6ZiKnIY/1DfUH5bqyP4A7ZYOC0nuHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t48qxLaC3apEI27Se6aO5gsLp4AuAMczcizLb7shhj5UjXcgOs/SxXK5uuVI3NDGz SXt/RKWEsC15xP1l8i89OkYt1UoQKDMI/QSMSMgey4DqZrk+MIzJe4/BIhB3YEimLS ZAOe2W4Xtk4wBzsa7eRyQxWD96NELXsJtd6EXDPc= 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.8 607/633] Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb Date: Tue, 27 Oct 2020 14:55:50 +0100 Message-Id: <20201027135551.293834425@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 a5fef9aa419fd..91a0c84d55c97 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2849,6 +2849,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