aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2013-08-26 03:06:30 -0400
committerGustavo Padovan <gustavo.padovan@collabora.co.uk>2013-09-16 13:35:54 -0400
commit06f43cbc4d61922d5a14c28909f02ae9c7fc5283 (patch)
treed18bbd420c190a7db64abdb66fb89cede2e0eb8f /net/bluetooth
parentf81fe64f3d3bc76c1a8d3edb80b54219a60ff291 (diff)
Bluetooth: Fix handling of getpeername() for HCI sockets
The HCI sockets do not have a peer associated with it and so make sure that getpeername() returns EOPNOTSUPP since this operation is actually not supported on HCI sockets. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_sock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index c45ec25aefb9..d8589410142f 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -699,6 +699,9 @@ static int hci_sock_getname(struct socket *sock, struct sockaddr *addr,
699 699
700 BT_DBG("sock %p sk %p", sock, sk); 700 BT_DBG("sock %p sk %p", sock, sk);
701 701
702 if (peer)
703 return -EOPNOTSUPP;
704
702 if (!hdev) 705 if (!hdev)
703 return -EBADFD; 706 return -EBADFD;
704 707