From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFE82313550; Thu, 28 May 2026 20:31:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000316; cv=none; b=hxijYJDNx/Oz1IRHFldVht7OiFEnjc7VdhapmODa9bQIQxIxoR9Wp9SRD25Whuzta0oZjmVNdZyDPOgOkQntIP+8o00rbTrIMY5DmoFcCbkPBRYfKmM+i7MnVKKcvBTqJ6Tc+z9oYmmC4osAdCxir3HDWcLjfazdbCXEl3omqek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780000316; c=relaxed/simple; bh=G4Ojz9deQ72q9wQyrSj7KhZoL8PfZY0aolNIMG5NlYQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hu7MwEHbOXxbH5GTPE1Tbsp6xf7CtH7R2/65U/Rt2y8cKdSZ75wSKo8dYY8AYiLhgLoUm597dOWoayLqnKo092zqnAC+unYbx98+QCUqRo9be0eHaUi/w2es6VrtzgVYa2EVDkhtYfZ+KSH6yd33wTVqOgcKcBDOmXXu/At+alQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=VAHgUQ1N; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="VAHgUQ1N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 493EF1F000E9; Thu, 28 May 2026 20:31:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780000315; bh=8w/mJSoMtTLC/CdPMnm0GN8j8M0IGgcOoM+c+Grap4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=VAHgUQ1N6we1poMJTg5Dl9eVdTV/G4lwGQ82WZl4xjXB435FTPXNvBB7439BMK3yA DYO1pVlZZMofDuURWxWP3F5789LR91ZVWvHuR8hr4sYMKHds7/K0SlR1UY8Oy7MQUK 7cm3hmqXx0Xrc+8DUAD0hJUo9X6Inui6exNdcdZU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jiajia Liu , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.18 353/377] Bluetooth: btmtk: fix urb->setup_packet leak in error paths Date: Thu, 28 May 2026 21:49:51 +0200 Message-ID: <20260528194648.646129407@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194638.371537336@linuxfoundation.org> References: <20260528194638.371537336@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiajia Liu [ Upstream commit dd1dda6b8d6e1f4376a5b3055a04f0ecbdb4d6bd ] The setup_packet of control urb is not freed if usb_submit_urb fails or the submitted urb is killed. Add free in these two paths. Fixes: a1c49c434e150 ("Bluetooth: btusb: Add protocol support for MediaTek MT7668U USB devices") Signed-off-by: Jiajia Liu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/btmtk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c index cf05746e9db5a..38ba8f2bd2f96 100644 --- a/drivers/bluetooth/btmtk.c +++ b/drivers/bluetooth/btmtk.c @@ -496,6 +496,7 @@ static void btmtk_usb_wmt_recv(struct urb *urb) return; } else if (urb->status == -ENOENT) { /* Avoid suspend failed when usb_kill_urb */ + kfree(urb->setup_packet); return; } @@ -569,6 +570,7 @@ static int btmtk_usb_submit_wmt_recv_urb(struct hci_dev *hdev) if (err != -EPERM && err != -ENODEV) bt_dev_err(hdev, "urb %p submission failed (%d)", urb, -err); + kfree(dr); usb_unanchor_urb(urb); } -- 2.53.0