From akpm@linux-foundation.org Thu May 10 23:04:45 2007 Message-Id: <200705110604.l4B64Elu008275@shell0.pdx.osdl.net> Subject: USB: auerswald: fix file release handler To: greg@kroah.com Cc: akpm@linux-foundation.org, jirislaby@gmail.com From: akpm@linux-foundation.org Date: Thu, 10 May 2007 23:04:14 -0700 From: Andrew Morton 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 Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/auerswald.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) --- a/drivers/usb/misc/auerswald.c +++ b/drivers/usb/misc/auerswald.c @@ -1822,16 +1822,10 @@ static int auerchar_release (struct inod 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 */