Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3711655ybv; Mon, 10 Feb 2020 05:08:53 -0800 (PST) X-Google-Smtp-Source: APXvYqx9blGJU0MFdWaB2q/3lauTPmoWNOJz0hDGCe45DF/2eCOmDZA4otAyCRSsQd5pKv67UOTe X-Received: by 2002:a05:6830:2111:: with SMTP id i17mr942606otc.24.1581340133376; Mon, 10 Feb 2020 05:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581340133; cv=none; d=google.com; s=arc-20160816; b=zVzU7NP7kYEOMbs738D03KxoYUWMTh226OBpM2HzwrUttl67KXMvsV5xtw2p2aJV78 6px+yFaduQ2aqo9BMeQthpglFp2DmgTcdEgw1mOxSAbfcpsrbKS3YBfrbe3LbatyTIrY 9CxPRwSsLUhJa+e+ax7gyBBbWFuHHOYRLdx6Dx526t2a3ZJKcWEfEEuKjj1ySNKCKnqb Km4VdaWBro5v756rFvlx6KlsrYYHeIyqM3xzMEAskV5/DbZ+X8m9IZHhz2YOBVLhZD5m GIKO6NUq2OjXFy++vhADoZmiJezoueR1Htg6WxQxoXnA0miuQjat8YJAOzfGDw7IbMIn Y8AQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HHZU2Lo0gx8/BSkIoWR5Nycz+qTClmmUWZ5zRSqwpMY=; b=y0vd7E3nrCvmIy3Isu7LTxqZPcRXYfFLqtPp7AIMcPjGj8ja/cwJPa53WIm/SfkEug i+QcIggOBpkOermDzezTmcFjdi9vwGkffhXEwBG+m91J6BG/3lNENdCazVLWyZqqsi6I O7u7yswD83goCn/FeGbHrpx6WZKD89YyTy9cpMU4OLy6ayYGeiAtT7WCdIPInF2uWSlo rt2T2tbGMFUYe2x+jvWIgHSR4R1Eh2r7fSoAz7sarJOHyg1P3Hu9QzCSB87qWFgkjMK0 MbxZcGGoasFl2tKj4k8H/IDgWUwx4MN9ElAqaQIc/UGFtjN3IW5lXCu5X0vQaWVJHKr7 rupA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Evcli9vd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j8si160653otr.161.2020.02.10.05.08.41; Mon, 10 Feb 2020 05:08:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Evcli9vd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730710AbgBJNIi (ORCPT + 99 others); Mon, 10 Feb 2020 08:08:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:37456 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728971AbgBJMja (ORCPT ); Mon, 10 Feb 2020 07:39:30 -0500 Received: from localhost (unknown [209.37.97.194]) (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 0DA2C20842; Mon, 10 Feb 2020 12:39:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338370; bh=H1rDOZ11KHe0nX1EtfcHPf1Y4oEDWPCo9Bgq0ldHZUo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Evcli9vdPFYcRLCcn8xM0Pojym3pJeZ3+iFcTeTUq/YQTCsBiBxw0ln9VJ5SpZ7vb i+OxVUcer7oYp5Rt8wGF3jA0jH4j0FydhHBZ3uZqeHB5LJfsZNyeguh5V8JhqnYeUq idY5fomye0PlZ06zaVGO3VpZvFdxp44d+YffdNfM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Marcel Holtmann Subject: [PATCH 5.5 040/367] Bluetooth: btusb: fix memory leak on fw Date: Mon, 10 Feb 2020 04:29:13 -0800 Message-Id: <20200210122427.695693359@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122423.695146547@linuxfoundation.org> References: <20200210122423.695146547@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King commit 3168c19d7eb17a0108a3b60ad8e8c1b18ea05c63 upstream. Currently the error return path when the call to btusb_mtk_hci_wmt_sync fails does not free fw. Fix this by returning via the error_release_fw label that performs the free'ing. Addresses-Coverity: ("Resource leak") Fixes: a1c49c434e15 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices") Signed-off-by: Colin Ian King Signed-off-by: Marcel Holtmann Signed-off-by: Greg Kroah-Hartman --- drivers/bluetooth/btusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2867,7 +2867,7 @@ static int btusb_mtk_setup_firmware(stru err = btusb_mtk_hci_wmt_sync(hdev, &wmt_params); if (err < 0) { bt_dev_err(hdev, "Failed to send wmt rst (%d)", err); - return err; + goto err_release_fw; } /* Wait a few moments for firmware activation done */