Re: [PATCH v2 0/2] Bluetooth: btrtl: Fix NULL return on errors in btrtl_initialize()

From: patchwork-bot+bluetooth

Date: Thu Nov 19 2026 - 13:50:18 EST


Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>:

On Thu, 19 Nov 2026 03:24:13 +0000 you wrote:
> In btrtl_initialize(), the `err_free` error path frees `btrtl_dev` and
> returns `ERR_PTR(ret)`. Because earlier calls in btrtl_initialize() set
> `ret` to 0 on success, any subsequent failure path that jumps to
> `err_free` without setting `ret` to a negative error code causes
> btrtl_initialize() to return `ERR_PTR(0)` (`NULL`).
>
> Since the caller btrtl_setup_realtek() only checks `IS_ERR(btrtl_dev)`,
> a `NULL` return bypasses the error check and causes a NULL pointer
> dereference in btrtl_download_firmware().
>
> [...]

Here is the summary with links:
- [v2,1/2] Bluetooth: btrtl: Propagate errors if btrtl_vendor_read_reg16() fails
https://git.kernel.org/bluetooth/bluetooth-next/c/c3cdaaa5cb5b
- [v2,2/2] Bluetooth: btrtl: Return -ENOMEM if bt_skb_alloc() fails
https://git.kernel.org/bluetooth/bluetooth-next/c/fc4527d1e1b6

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html