[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 <marcel@holtmann.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user