Skip to content

Commit

Permalink
USB: auerswald: fix file release handler
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Greg Kroah-Hartman committed May 23, 2007
1 parent fcbd963 commit be23edf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/usb/misc/auerswald.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit be23edf

Please sign in to comment.