Skip to content

Commit

Permalink
Bluetooth: Fix kernel hci_dev_open timeout reset
Browse files Browse the repository at this point in the history
Handle -EALREADY error in hci_sock of hci_dev_open as indication that
the HCI device is already open. This was causing reset inducing timeout,
and removed unused/useless check of failure in power-up code.

Signed-off-by: Brian Gix <bgix@codeaurora.org>
(cherry picked from commit 9bb9d38e700c8deb08f6347f43be250b9ec9e3be)

Change-Id: Id42c5acf37bb5657c898fb358bc2f45621ea5044
Signed-off-by: Oguri, Srivalli <oguri@codeaurora.org>
  • Loading branch information
Brian Gix authored and javilonas committed Jun 8, 2015
1 parent 8908918 commit bc90705
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/bluetooth/hci_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,12 @@ static int hci_sock_ioctl(struct socket *sock, unsigned int cmd,
case HCIDEVUP:
if (!capable(CAP_NET_ADMIN))
return -EPERM;
return hci_dev_open(arg);

err = hci_dev_open(arg);
if (!err || err == -EALREADY)
return 0;
else
return err;

case HCIDEVDOWN:
if (!capable(CAP_NET_ADMIN))
Expand Down

0 comments on commit bc90705

Please sign in to comment.