mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-12 08:00:09 +00:00
Bluetooth: Add missing cmd_status() in mgmt
Improve error handling in mgmt load_keys() Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This commit is contained in:
parent
56b7d13785
commit
b7059136d7
@ -917,7 +917,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len)
|
||||
cp = (void *) data;
|
||||
|
||||
if (len < sizeof(*cp))
|
||||
return -EINVAL;
|
||||
return cmd_status(sk, index, MGMT_OP_LOAD_KEYS, EINVAL);
|
||||
|
||||
key_count = get_unaligned_le16(&cp->key_count);
|
||||
|
||||
@ -925,7 +925,7 @@ static int load_keys(struct sock *sk, u16 index, unsigned char *data, u16 len)
|
||||
if (expected_len != len) {
|
||||
BT_ERR("load_keys: expected %u bytes, got %u bytes",
|
||||
len, expected_len);
|
||||
return -EINVAL;
|
||||
return cmd_status(sk, index, MGMT_OP_LOAD_KEYS, EINVAL);
|
||||
}
|
||||
|
||||
hdev = hci_dev_get(index);
|
||||
|
Loading…
x
Reference in New Issue
Block a user