[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABBYNZLpMCTy8z8ObEU90gqenb58VoB2EZKbZJfWK_J=h45Qew@mail.gmail.com>
Date: Thu, 24 Oct 2024 10:47:17 -0400
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: Chris Lu <chris.lu@...iatek.com>
Cc: Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg <johan.hedberg@...il.com>,
Sean Wang <sean.wang@...iatek.com>, Aaron Hou <aaron.hou@...iatek.com>,
Steve Lee <steve.lee@...iatek.com>, linux-bluetooth <linux-bluetooth@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-mediatek <linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v1] Bluetooth: btmtk: adjust the position to init iso data anchor
Hi Chris,
On Wed, Oct 23, 2024 at 7:37 AM Chris Lu <chris.lu@...iatek.com> wrote:
>
> MediaTek iso data anchor init should be move to where MediaTek
> claims iso data interface.
> If there is an unexpected usb disconnect during setup flow,
> it will cause a NULL pointer crash issue when releasing iso
> anchor since the anchor wan't been init yet. Adjust the position
> to do iso data anchor init.
>
> Signed-off-by: Chris Lu <chris.lu@...iatek.com>
Please add the backtrace or a Link tag if there is an issue/bug open.
Also it is important to always include a Fixes tag with tha hash that
introduced the problem, specially in case of a crash since it might be
a good idea to backport to fix.
> ---
> drivers/bluetooth/btmtk.c | 1 -
> drivers/bluetooth/btusb.c | 2 ++
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> index b7fc14aafc74..8a3f7c3fcfec 100644
> --- a/drivers/bluetooth/btmtk.c
> +++ b/drivers/bluetooth/btmtk.c
> @@ -1215,7 +1215,6 @@ static int btmtk_usb_isointf_init(struct hci_dev *hdev)
> struct sk_buff *skb;
> int err;
>
> - init_usb_anchor(&btmtk_data->isopkt_anchor);
> spin_lock_init(&btmtk_data->isorxlock);
>
> __set_mtk_intr_interface(hdev);
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 9970470c9d15..15c0885c37cd 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2628,6 +2628,8 @@ static void btusb_mtk_claim_iso_intf(struct btusb_data *data)
> struct btmtk_data *btmtk_data = hci_get_priv(data->hdev);
> int err;
>
> + init_usb_anchor(&btmtk_data->isopkt_anchor);
> +
> err = usb_driver_claim_interface(&btusb_driver,
> btmtk_data->isopkt_intf, data);
> if (err < 0) {
> --
> 2.18.0
>
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists