From: Johan Hedberg Date: Wed, 22 Feb 2012 16:11:53 +0000 (+0200) Subject: Bluetooth: Fix EIR data clearing when powering off X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e59fda8dc14c173b74b5e9d5c8d72849d2ff6b5f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Bluetooth: Fix EIR data clearing when powering off When powering off we should assume that the EIR data isn't valid anymore. This patch makes sure it gets cleared in hci_dev_do_close and thereby ensures that a correct new EIR is recreated when powering on again. Signed-off-by: Johan Hedberg Acked-by: Marcel Holtmann --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index e1dadeea4c2f..2d75ffb42f7d 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -794,6 +794,8 @@ static int hci_dev_do_close(struct hci_dev *hdev) /* Clear flags */ hdev->flags = 0; + memset(hdev->eir, 0, sizeof(hdev->eir)); + hci_req_unlock(hdev); hci_dev_put(hdev);