Skip to content

Commit

Permalink
staging: tidspbridge: check return code of get_user
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vasiliy Kulikov authored and Greg Kroah-Hartman committed Sep 5, 2010
1 parent 2fac6c2 commit b04462a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/staging/tidspbridge/pmgr/dspapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b04462a

Please sign in to comment.