]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
Bluetooth: mgmt: Fix the command returns garbage parameter value
authorTedd Ho-Jeong An <tedd.an@intel.com>
Wed, 26 May 2021 17:36:22 +0000 (10:36 -0700)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 27 May 2021 15:09:11 +0000 (17:09 +0200)
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>
net/bluetooth/mgmt.c

index b44e19c69c445dbdd8841c8fc3367bea3dacd123..91d36c3bf23eecf4a1bee4f95ae3e903dc6d3e6e 100644 (file)
@@ -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,