Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180615
b: refs/heads/master
c: ddeee0b
h: refs/heads/master
i:
  180613: bbea07e
  180611: c593cb6
  180607: 27b6b1c
v: v3
  • Loading branch information
Linus Torvalds authored and Greg Kroah-Hartman committed Feb 16, 2010
1 parent 539621c commit 98e900c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 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: d4a4683ca054ed9917dfc9e3ff0f7ecf74ad90d6
refs/heads/master: ddeee0b2eec2a51b0712b04de4b39e7bec892a53
40 changes: 26 additions & 14 deletions trunk/drivers/usb/core/devio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1334,14 +1334,11 @@ static int processcompl(struct async *as, void __user * __user *arg)
}
}

free_async(as);

if (put_user(addr, (void __user * __user *)arg))
return -EFAULT;
return 0;

err_out:
free_async(as);
return -EFAULT;
}

Expand Down Expand Up @@ -1371,20 +1368,28 @@ static struct async *reap_as(struct dev_state *ps)
static int proc_reapurb(struct dev_state *ps, void __user *arg)
{
struct async *as = reap_as(ps);
if (as)
return processcompl(as, (void __user * __user *)arg);
if (as) {
int retval = processcompl(as, (void __user * __user *)arg);
free_async(as);
return retval;
}
if (signal_pending(current))
return -EINTR;
return -EIO;
}

static int proc_reapurbnonblock(struct dev_state *ps, void __user *arg)
{
int retval;
struct async *as;

if (!(as = async_getcompleted(ps)))
return -EAGAIN;
return processcompl(as, (void __user * __user *)arg);
as = async_getcompleted(ps);
retval = -EAGAIN;
if (as) {
retval = processcompl(as, (void __user * __user *)arg);
free_async(as);
}
return retval;
}

#ifdef CONFIG_COMPAT
Expand Down Expand Up @@ -1497,7 +1502,6 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
}
}

free_async(as);
if (put_user(ptr_to_compat(addr), (u32 __user *)arg))
return -EFAULT;
return 0;
Expand All @@ -1506,20 +1510,28 @@ static int processcompl_compat(struct async *as, void __user * __user *arg)
static int proc_reapurb_compat(struct dev_state *ps, void __user *arg)
{
struct async *as = reap_as(ps);
if (as)
return processcompl_compat(as, (void __user * __user *)arg);
if (as) {
int retval = processcompl_compat(as, (void __user * __user *)arg);
free_async(as);
return retval;
}
if (signal_pending(current))
return -EINTR;
return -EIO;
}

static int proc_reapurbnonblock_compat(struct dev_state *ps, void __user *arg)
{
int retval;
struct async *as;

if (!(as = async_getcompleted(ps)))
return -EAGAIN;
return processcompl_compat(as, (void __user * __user *)arg);
retval = -EAGAIN;
as = async_getcompleted(ps);
if (as) {
retval = processcompl_compat(as, (void __user * __user *)arg);
free_async(as);
}
return retval;
}


Expand Down

0 comments on commit 98e900c

Please sign in to comment.