mirror of
https://github.com/Ysurac/openmptcprouter.git
synced 2025-03-09 15:40:20 +00:00
27 lines
886 B
Diff
27 lines
886 B
Diff
From 7268de0027e749ddb10946869a5e152f84f1560d Mon Sep 17 00:00:00 2001
|
|
From: Phil Elwell <phil@raspberrypi.com>
|
|
Date: Wed, 7 Aug 2024 17:41:31 +0100
|
|
Subject: [PATCH 504/697] Bluetooth: hci_sync: Fix crash on NULL parent
|
|
|
|
Although later functions can handle a NULL fwnode, fwnode can't handle
|
|
being passed a NULL pointer.
|
|
|
|
See: https://github.com/raspberrypi/linux/issues/6305
|
|
|
|
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
|
---
|
|
net/bluetooth/hci_sync.c | 3 ++-
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
--- a/net/bluetooth/hci_sync.c
|
|
+++ b/net/bluetooth/hci_sync.c
|
|
@@ -4861,7 +4861,8 @@ static const struct {
|
|
*/
|
|
static int hci_dev_setup_sync(struct hci_dev *hdev)
|
|
{
|
|
- struct fwnode_handle *fwnode = dev_fwnode(hdev->dev.parent);
|
|
+ struct fwnode_handle *fwnode =
|
|
+ hdev->dev.parent ? dev_fwnode(hdev->dev.parent) : NULL;
|
|
int ret = 0;
|
|
bool invalid_bdaddr;
|
|
size_t i;
|