Commit b04462a1 authored by Vasiliy Kulikov's avatar Vasiliy Kulikov Committed by Greg Kroah-Hartman
Browse files

staging: tidspbridge: check return code of get_user



Function get_user may fail. Check for it.

Signed-off-by: default avatarVasiliy Kulikov <segooon@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2fac6c29
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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);