Skip to contentSkip to conversation

Bluetooth: Fix updating the right variable in update_scan_rsp_data()

PATCH In review [email protected] 2 participants 2 messages Oct 16, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: Fix updating the right variable in update_scan_rsp_data()

From: Johan Hedberg <[email protected]>

This function should be operating on scan_rsp_data_len and scan_rsp_data and not the advertising data variables.

---
 net/bluetooth/mgmt.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/bluetooth/mgmt.c +4 -4
index 0bf823b..a727b47 100644
@@ -575,12 +575,12 @@ static void update_scan_rsp_data(struct hci_request *req)
 
 	len = create_scan_rsp_data(hdev, cp.data);
 
-	if (hdev->adv_data_len == len &&
-	    memcmp(cp.data, hdev->adv_data, len) == 0)
+	if (hdev->scan_rsp_data_len == len &&
+	    memcmp(cp.data, hdev->scan_rsp_data, len) == 0)
 		return;
 
-	memcpy(hdev->adv_data, cp.data, sizeof(cp.data));
-	hdev->adv_data_len = len;
+	memcpy(hdev->scan_rsp_data, cp.data, sizeof(cp.data));
+	hdev->scan_rsp_data_len = len;
 
 	cp.length = len;
 
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw

Hi Johan,

Quoted 7 lines

This function should be operating on scan_rsp_data_len and scan_rsp_data and not the advertising data variables.

---
net/bluetooth/mgmt.c | 8 ++++----

1 file changed, 4 insertions(+), 4 deletions(-)

good catch. Patch has been applied to bluetooth-next tree.

Regards

Marcel