USB: auerswald: fix file release handler
authorAndrew Morton <akpm@linux-foundation.org>
Fri, 11 May 2007 06:04:14 +0000 (23:04 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 May 2007 06:45:49 +0000 (23:45 -0700)
If this down_interruptible() does fail due to signal_pending() then the state
of the driver will get trashed in interesting ways, because userspace cannot
and will not retry the close().

Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/auerswald.c

index 88fb56d..cac1500 100644 (file)
@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file)
        pauerswald_t cp;
        dbg("release");
 
-       /* get the mutexes */
-       if (down_interruptible (&ccp->mutex)) {
-               return -ERESTARTSYS;
-       }
+       down(&ccp->mutex);
        cp = ccp->auerdev;
        if (cp) {
-               if (down_interruptible (&cp->mutex)) {
-                       up (&ccp->mutex);
-                       return -ERESTARTSYS;
-               }
+               down(&cp->mutex);
                /* remove an open service */
                auerswald_removeservice (cp, &ccp->scontext);
                /* detach from device */