diff mbox series

Bluetooth: Fix get device flags command returns garbage parameter

Message ID 20210526002816.413660-1-hj.tedd.an@gmail.com (mailing list archive)
State New, archived
Headers show
Series Bluetooth: Fix get device flags command returns garbage parameter | expand

Commit Message

Tedd Ho-Jeong An May 26, 2021, 12:28 a.m. UTC
From: Tedd Ho-Jeong An <tedd.an@intel.com>

This patch memset the response parameter so it doesn't return the garbage
value when the Get Device Flags command fails.

Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com>
---
 net/bluetooth/mgmt.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Marcel Holtmann May 26, 2021, 3:02 p.m. UTC | #1
Hi Tedd,

> This patch memset the response parameter so it doesn't return the garbage
> value when the Get Device Flags command fails.
> 

please add a Fixes: tag here.

Regards

Marcel
diff mbox series

Patch

diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index b44e19c69c44..91d36c3bf23e 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4061,6 +4061,8 @@  static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	hci_dev_lock(hdev);
 
+	memset(&rp, 0, sizeof(rp));
+
 	if (cp->addr.type == BDADDR_BREDR) {
 		br_params = hci_bdaddr_list_lookup_with_flags(&hdev->whitelist,
 							      &cp->addr.bdaddr,