]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Bluetooth: Add missing cmd_status() in mgmt
authorGustavo F. Padovan <padovan@profusion.mobi>
Fri, 14 Oct 2011 22:23:27 +0000 (19:23 -0300)
committerGustavo F. Padovan <padovan@profusion.mobi>
Fri, 14 Oct 2011 22:23:27 +0000 (19:23 -0300)
Improve error handling in mgmt load_keys()

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
net/bluetooth/mgmt.c

index 42e26146a9a6fdf3a6b18f7e3f0306d22858f61f..9d0e223855735f87b42b48e1acf657dde7920a46 100644 (file)
@@ -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);