diff options
author | Vasiliy Kulikov <segooon@gmail.com> | 2010-09-05 22:32:45 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-09-05 16:59:50 -0700 |
commit | b04462a143afde542ad9e5a1df4fcfbff6d30249 (patch) | |
tree | b87a0f262e9f6c0f5a2e015cfea16d8f4b19dd76 | |
parent | 2fac6c290f9e7ac98256e9deaa668f6c2c305cf2 (diff) |
staging: tidspbridge: check return code of get_user
Function get_user may fail. Check for it.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/tidspbridge/pmgr/dspapi.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/staging/tidspbridge/pmgr/dspapi.c b/drivers/staging/tidspbridge/pmgr/dspapi.c index b23591b0f414..faf8304f55e2 100644 --- a/drivers/staging/tidspbridge/pmgr/dspapi.c +++ b/drivers/staging/tidspbridge/pmgr/dspapi.c @@ -872,7 +872,11 @@ u32 procwrap_load(union trapped_args *args, void *pr_ctxt) /* number of elements in the envp array including NULL */ count = 0; do { - get_user(temp, args->args_proc_load.user_envp + count); + if (get_user(temp, + args->args_proc_load.user_envp + count)) { + status = -EFAULT; + goto func_cont; + } count++; } while (temp); envp = kmalloc(count * sizeof(u8 *), GFP_KERNEL); |