summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sock.c
diff options
context:
space:
mode:
authorMarcel Holtmann2013-08-26 18:29:39 +0200
committerGustavo Padovan2013-09-16 19:35:55 +0200
commitc2371e80b3d0d11df10579a39cdad3310c944325 (patch)
tree4c6128cf06f45de22b2659f7963256ebd37cb8c1 /net/bluetooth/hci_sock.c
parentBluetooth: Report error for HCI reset ioctl when device is down (diff)
downloadkernel-qcow2-linux-c2371e80b3d0d11df10579a39cdad3310c944325.tar.gz
kernel-qcow2-linux-c2371e80b3d0d11df10579a39cdad3310c944325.tar.xz
kernel-qcow2-linux-c2371e80b3d0d11df10579a39cdad3310c944325.zip
Bluetooth: Fix error handling for HCI socket options
The HCI sockets for monitor and control do not support any HCI specific socket options and if tried, an error will be returned. However the error used is EINVAL and that is not really descriptive. To make it clear that these sockets are not handling HCI socket options, return EBADFD instead. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth/hci_sock.c')
-rw-r--r--net/bluetooth/hci_sock.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index 49c5c62ac0c9..f92e913c8a03 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -921,7 +921,7 @@ static int hci_sock_setsockopt(struct socket *sock, int level, int optname,
lock_sock(sk);
if (hci_pi(sk)->channel != HCI_CHANNEL_RAW) {
- err = -EINVAL;
+ err = -EBADFD;
goto done;
}
@@ -1007,7 +1007,7 @@ static int hci_sock_getsockopt(struct socket *sock, int level, int optname,
lock_sock(sk);
if (hci_pi(sk)->channel != HCI_CHANNEL_RAW) {
- err = -EINVAL;
+ err = -EBADFD;
goto done;
}