Unverified Commit b05f2de3 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!6279 Bluetooth: Avoid potential use-after-free in hci_error_reset

parents 6620766a 161dc9a3
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -2318,6 +2318,7 @@ static void hci_error_reset(struct work_struct *work)
{
	struct hci_dev *hdev = container_of(work, struct hci_dev, error_reset);

	hci_dev_hold(hdev);
	BT_DBG("%s", hdev->name);

	if (hdev->hw_error)
@@ -2325,10 +2326,10 @@ static void hci_error_reset(struct work_struct *work)
	else
		bt_dev_err(hdev, "hardware error 0x%2.2x", hdev->hw_error_code);

	if (hci_dev_do_close(hdev))
		return;

	if (!hci_dev_do_close(hdev))
		hci_dev_do_open(hdev);

	hci_dev_put(hdev);
}

void hci_uuids_clear(struct hci_dev *hdev)