Skip to content

Commit 8d7a398

Browse files
tedd-angregkh
authored andcommitted
Bluetooth: mgmt: Fix the command returns garbage parameter value
[ Upstream commit 02ce2c2 ] When the Get Device Flags command fails, it returns the error status with the parameters filled with the garbage values. Although the parameters are not used, it is better to fill with zero than the random values. Signed-off-by: Tedd Ho-Jeong An <tedd.an@intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 05298f1 commit 8d7a398

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎net/bluetooth/mgmt.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4038,6 +4038,8 @@ static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
40384038

40394039
hci_dev_lock(hdev);
40404040

4041+
memset(&rp, 0, sizeof(rp));
4042+
40414043
if (cp->addr.type == BDADDR_BREDR) {
40424044
br_params = hci_bdaddr_list_lookup_with_flags(&hdev->whitelist,
40434045
&cp->addr.bdaddr,

0 commit comments

Comments
 (0)