Commit 59da0b38 authored by Dan Carpenter's avatar Dan Carpenter Committed by Marcel Holtmann

Bluetooth: sco: prevent information leak in sco_conn_defer_accept()

Smatch complains that some of these struct members are not initialized
leading to a stack information disclosure:

    net/bluetooth/sco.c:778 sco_conn_defer_accept() warn:
    check that 'cp.retrans_effort' doesn't leak information

This seems like a valid warning.  I've added a default case to fix
this issue.

Fixes: 2f69a82a ("Bluetooth: Use voice setting in deferred SCO connection request")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 2cdff8ca
...@@ -773,6 +773,11 @@ static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting) ...@@ -773,6 +773,11 @@ static void sco_conn_defer_accept(struct hci_conn *conn, u16 setting)
cp.max_latency = cpu_to_le16(0xffff); cp.max_latency = cpu_to_le16(0xffff);
cp.retrans_effort = 0xff; cp.retrans_effort = 0xff;
break; break;
default:
/* use CVSD settings as fallback */
cp.max_latency = cpu_to_le16(0xffff);
cp.retrans_effort = 0xff;
break;
} }
hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ, hci_send_cmd(hdev, HCI_OP_ACCEPT_SYNC_CONN_REQ,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment