Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15514
b: refs/heads/master
c: c8dd770
h: refs/heads/master
v: v3
  • Loading branch information
Sam Bishop authored and Greg Kroah-Hartman committed Jan 4, 2006
1 parent 4a2cdfb commit 30faf4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cb5b3f6950b4fbad9d8d41756f49aba792804b5b
refs/heads/master: c8dd7709c534ab0d713aa698c99132b6c812b57c
7 changes: 5 additions & 2 deletions trunk/drivers/usb/usb-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou
int retval = 0;
struct urb *urb = NULL;
char *buf = NULL;
size_t writesize = min(count, MAX_TRANSFER);
size_t writesize = min(count, (size_t)MAX_TRANSFER);

dev = (struct usb_skel *)file->private_data;

Expand All @@ -175,7 +175,10 @@ static ssize_t skel_write(struct file *file, const char *user_buffer, size_t cou
goto exit;

/* limit the number of URBs in flight to stop a user from using up all RAM */
down (&dev->limit_sem);
if (down_interruptible(&dev->limit_sem)) {
retval = -ERESTARTSYS;
goto exit;
}

/* create a urb, and a buffer for it, and copy the data to the urb */
urb = usb_alloc_urb(0, GFP_KERNEL);
Expand Down

0 comments on commit 30faf4d

Please sign in to comment.