From: Marcel Holtmann Date: Mon, 26 Aug 2013 16:29:39 +0000 (-0700) Subject: Bluetooth: Fix error handling for HCI socket options X-Git-Tag: upstream/snapshot3+hdmi~3994^2~225^2~24^2~67 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c2371e80b3d0d11df10579a39cdad3310c944325;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c index 49c5c62..f92e913 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; }