Commit be23edf8 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

USB: auerswald: fix file release handler

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: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fcbd9639
...@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file) ...@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file)
pauerswald_t cp; pauerswald_t cp;
dbg("release"); dbg("release");
/* get the mutexes */ down(&ccp->mutex);
if (down_interruptible (&ccp->mutex)) {
return -ERESTARTSYS;
}
cp = ccp->auerdev; cp = ccp->auerdev;
if (cp) { if (cp) {
if (down_interruptible (&cp->mutex)) { down(&cp->mutex);
up (&ccp->mutex);
return -ERESTARTSYS;
}
/* remove an open service */ /* remove an open service */
auerswald_removeservice (cp, &ccp->scontext); auerswald_removeservice (cp, &ccp->scontext);
/* detach from device */ /* detach from device */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment