Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165055
b: refs/heads/master
c: 7981998
h: refs/heads/master
i:
  165053: c8e0dc0
  165051: e8a9268
  165047: e076171
  165039: 2f3476f
  165023: 61e8a60
  164991: 63c4775
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Sep 23, 2009
1 parent 68dc0ed commit f507255
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 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: e7389cc9a7ff7c6e760e741c81a751c834f7d145
refs/heads/master: 798199867385417ba6494472e39c016e3340758c
13 changes: 10 additions & 3 deletions trunk/drivers/usb/usb-skeleton.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,16 @@ 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 */
if (down_interruptible(&dev->limit_sem)) {
retval = -ERESTARTSYS;
goto exit;
if (!file->f_flags & O_NONBLOCK) {
if (down_interruptible(&dev->limit_sem)) {
retval = -ERESTARTSYS;
goto exit;
}
} else {
if (down_trylock(&dev->limit_sem)) {
retval = -EAGAIN;
goto exit;
}
}

spin_lock_irq(&dev->err_lock);
Expand Down

0 comments on commit f507255

Please sign in to comment.