diff options
author | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-14 19:23:27 -0300 |
---|---|---|
committer | Gustavo F. Padovan <padovan@profusion.mobi> | 2011-10-14 19:23:27 -0300 |
commit | b7059136d765603f2cff05d5e2d4850a4e505ec8 (patch) | |
tree | 6b233c1113acae46b04c3815a4137b1c37d82834 /net/bluetooth/mgmt.c | |
parent | 56b7d137855eb02cba8aecbb67d49c24b43644b0 (diff) | |
download | lwn-b7059136d765603f2cff05d5e2d4850a4e505ec8.tar.gz lwn-b7059136d765603f2cff05d5e2d4850a4e505ec8.zip |
Bluetooth: Add missing cmd_status() in mgmt
Improve error handling in mgmt load_keys()
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Diffstat (limited to 'net/bluetooth/mgmt.c')
-rw-r--r-- | net/bluetooth/mgmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 42e26146a9a6..9d0e22385573 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -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); |