Skip to content

Commit

Permalink
Bluetooth: hci_sync: Fix crash on NULL parent
Browse files Browse the repository at this point in the history
Although later functions can handle a NULL fwnode, fwnode can't handle
being passed a NULL pointer.

See: raspberrypi#6305

Signed-off-by: Phil Elwell <[email protected]>
  • Loading branch information
pelwell authored and popcornmix committed Jan 2, 2025
1 parent 15f4c3d commit 527241f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/bluetooth/hci_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 527241f

Please sign in to comment.