patch-2.4.25 linux-2.4.25/drivers/usb/storage/usb.c

Next file: linux-2.4.25/drivers/usb/usb.c
Previous file: linux-2.4.25/drivers/usb/storage/unusual_devs.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.24/drivers/usb/storage/usb.c linux-2.4.25/drivers/usb/storage/usb.c
@@ -332,6 +332,8 @@
 
 	/* set our name for identification purposes */
 	sprintf(current->comm, "usb-storage-%d", us->host_number);
+	
+	current->flags |= PF_MEMALLOC;
 
 	unlock_kernel();
 
@@ -726,6 +728,7 @@
 
 		/* allocate an IRQ callback if one is needed */
 		if ((ss->protocol == US_PR_CBI) && usb_stor_allocate_irq(ss)) {
+			up(&(ss->dev_semaphore));
 			usb_dec_dev_use(dev);
 			return NULL;
 		}
@@ -733,6 +736,7 @@
 		/* allocate the URB we're going to use */
 		ss->current_urb = usb_alloc_urb(0);
 		if (!ss->current_urb) {
+			up(&(ss->dev_semaphore));
 			usb_dec_dev_use(dev);
 			return NULL;
 		}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)