From ec8dab36e0738d3059980d144e34f16a26bbda7d Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 14 Jul 2008 20:13:53 +0200 Subject: [Bluetooth] Signal user-space for HIDP and BNEP socket errors When using the HIDP or BNEP kernel support, the user-space needs to know if the connection has been terminated for some reasons. Wake up the application if that happens. Otherwise kernel and user-space are no longer on the same page and weird behaviors can happen. Signed-off-by: Marcel Holtmann --- net/bluetooth/bnep/core.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'net/bluetooth/bnep') diff --git a/net/bluetooth/bnep/core.c b/net/bluetooth/bnep/core.c index f85d94643aaf..24e91eb7f649 100644 --- a/net/bluetooth/bnep/core.c +++ b/net/bluetooth/bnep/core.c @@ -507,6 +507,11 @@ static int bnep_session(void *arg) /* Delete network device */ unregister_netdev(dev); + /* Wakeup user-space polling for socket errors */ + s->sock->sk->sk_err = EUNATCH; + + wake_up_interruptible(s->sock->sk->sk_sleep); + /* Release the socket */ fput(s->sock->file); -- cgit v1.2.3-59-g8ed1b