All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: Fix get device flags command returns garbage parameter
@ 2021-05-26  0:28 Tedd Ho-Jeong An
  2021-05-26 15:02 ` Marcel Holtmann
  0 siblings, 1 reply; 2+ messages in thread
From: Tedd Ho-Jeong An @ 2021-05-26  0:28 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Tedd Ho-Jeong An

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(+)

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,
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Bluetooth: Fix get device flags command returns garbage parameter
  2021-05-26  0:28 [PATCH] Bluetooth: Fix get device flags command returns garbage parameter Tedd Ho-Jeong An
@ 2021-05-26 15:02 ` Marcel Holtmann
  0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2021-05-26 15:02 UTC (permalink / raw)
  To: Tedd Ho-Jeong An; +Cc: linux-bluetooth, Tedd Ho-Jeong An

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-26 15:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26  0:28 [PATCH] Bluetooth: Fix get device flags command returns garbage parameter Tedd Ho-Jeong An
2021-05-26 15:02 ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.