]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: cdc-wdm: poll must return POLLHUP if device is gone
authorBjørn Mork <bjorn@mork.no>
Wed, 9 May 2012 11:53:21 +0000 (13:53 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 30 May 2012 23:43:40 +0000 (00:43 +0100)
commit 616b6937e348ef2b4c6ea5fef2cd3c441145efb0 upstream.

Else the poll will be restarted indefinitely in a tight loop,
preventing final device cleanup.

Cc: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/usb/class/cdc-wdm.c

index cfe5be43d568f53e32d412d91d430090ce869de7..38d8c3333132dcfa15aa82a1772ad74c28f17fef 100644 (file)
@@ -511,7 +511,7 @@ static unsigned int wdm_poll(struct file *file, struct poll_table_struct *wait)
 
        spin_lock_irqsave(&desc->iuspin, flags);
        if (test_bit(WDM_DISCONNECTING, &desc->flags)) {
-               mask = POLLERR;
+               mask = POLLHUP | POLLERR;
                spin_unlock_irqrestore(&desc->iuspin, flags);
                goto desc_out;
        }