From: Gustavo F. Padovan Date: Fri, 14 Oct 2011 22:23:27 +0000 (-0300) Subject: Bluetooth: Add missing cmd_status() in mgmt X-Git-Tag: v3.3-rc1~182^2~44^2~536^2~65 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7059136d765603f2cff05d5e2d4850a4e505ec8;p=profile%2Fcommon%2Fkernel-common.git Bluetooth: Add missing cmd_status() in mgmt Improve error handling in mgmt load_keys() Signed-off-by: Gustavo F. Padovan --- diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 42e2614..9d0e223 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);