]>
Commit | Line | Data |
---|---|---|
48bb485e GKH |
1 | From 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn@mork.no> | |
3 | Date: Wed, 9 May 2012 13:53:21 +0200 | |
4 | Subject: USB: cdc-wdm: poll must return POLLHUP if device is gone | |
5 | MIME-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | From: Bjørn Mork <bjorn@mork.no> | |
10 | ||
11 | commit 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 upstream. | |
12 | ||
13 | Else the poll will be restarted indefinitely in a tight loop, | |
14 | preventing final device cleanup. | |
15 | ||
16 | Cc: Oliver Neukum <oliver@neukum.org> | |
17 | Signed-off-by: Bjørn Mork <bjorn@mork.no> | |
18 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
19 | ||
20 | --- | |
21 | drivers/usb/class/cdc-wdm.c | 2 +- | |
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | |
23 | ||
24 | --- a/drivers/usb/class/cdc-wdm.c | |
25 | +++ b/drivers/usb/class/cdc-wdm.c | |
26 | @@ -511,7 +511,7 @@ static unsigned int wdm_poll(struct file | |
27 | ||
28 | spin_lock_irqsave(&desc->iuspin, flags); | |
29 | if (test_bit(WDM_DISCONNECTING, &desc->flags)) { | |
30 | - mask = POLLERR; | |
31 | + mask = POLLHUP | POLLERR; | |
32 | spin_unlock_irqrestore(&desc->iuspin, flags); | |
33 | goto desc_out; | |
34 | } |