aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2007-05-11 02:04:14 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-23 02:45:49 -0400
commitbe23edf848b14d1b426c12f2f58e4949c4fbd695 (patch)
tree798a6f9a2d6e74d7e7d7e2de2e40c0343c17e700 /drivers
parentfcbd963912acc0c5d51bb27f8654f2a91fcff322 (diff)
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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/misc/auerswald.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/usb/misc/auerswald.c b/drivers/usb/misc/auerswald.c
index 88fb56d5db8f..cac1500cba62 100644
--- a/drivers/usb/misc/auerswald.c
+++ b/drivers/usb/misc/auerswald.c
@@ -1822,16 +1822,10 @@ static int auerchar_release (struct inode *inode, struct file *file)
1822 pauerswald_t cp; 1822 pauerswald_t cp;
1823 dbg("release"); 1823 dbg("release");
1824 1824
1825 /* get the mutexes */ 1825 down(&ccp->mutex);
1826 if (down_interruptible (&ccp->mutex)) {
1827 return -ERESTARTSYS;
1828 }
1829 cp = ccp->auerdev; 1826 cp = ccp->auerdev;
1830 if (cp) { 1827 if (cp) {
1831 if (down_interruptible (&cp->mutex)) { 1828 down(&cp->mutex);
1832 up (&ccp->mutex);
1833 return -ERESTARTSYS;
1834 }
1835 /* remove an open service */ 1829 /* remove an open service */
1836 auerswald_removeservice (cp, &ccp->scontext); 1830 auerswald_removeservice (cp, &ccp->scontext);
1837 /* detach from device */ 1831 /* detach from device */