linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
@ 2023-03-21 11:48 max.chou
  2023-03-29 19:50 ` patchwork-bot+bluetooth
  0 siblings, 1 reply; 2+ messages in thread
From: max.chou @ 2023-03-21 11:48 UTC (permalink / raw)
  To: marcel
  Cc: johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
	alex_lu, hildawu, max.chou

From: Max Chou <max.chou@realtek.com>

The btrtl_set_quirks() has accessed btrtl_dev->ic_info->lmp_subver since
b8e482d02513. However, if installing a Realtek Bluetooth controller
without the driver supported, it will hit the NULL point accessed.

Add a check for NULL to avoid the Kernel Oops.

Signed-off-by: Max Chou <max.chou@realtek.com>
---
 drivers/bluetooth/btrtl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 8fa7733812ad..0f256a8abef4 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -905,6 +905,9 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev)
 		break;
 	}
 
+	if (!btrtl_dev->ic_info)
+		return;
+
 	switch (btrtl_dev->ic_info->lmp_subver) {
 	case RTL_ROM_LMP_8703B:
 		/* 8723CS reports two pages for local ext features,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
  2023-03-21 11:48 [PATCH 1/1] Bluetooth: btrtl: check for NULL in btrtl_set_quirks() max.chou
@ 2023-03-29 19:50 ` patchwork-bot+bluetooth
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+bluetooth @ 2023-03-29 19:50 UTC (permalink / raw)
  To: Max Chou
  Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel,
	alex_lu, hildawu

Hello:

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

On Tue, 21 Mar 2023 19:48:26 +0800 you wrote:
> From: Max Chou <max.chou@realtek.com>
> 
> The btrtl_set_quirks() has accessed btrtl_dev->ic_info->lmp_subver since
> b8e482d02513. However, if installing a Realtek Bluetooth controller
> without the driver supported, it will hit the NULL point accessed.
> 
> Add a check for NULL to avoid the Kernel Oops.
> 
> [...]

Here is the summary with links:
  - [1/1] Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
    https://git.kernel.org/bluetooth/bluetooth-next/c/dfa0a31c0cee

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-29 19:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21 11:48 [PATCH 1/1] Bluetooth: btrtl: check for NULL in btrtl_set_quirks() max.chou
2023-03-29 19:50 ` patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).