[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1283711565-7375-1-git-send-email-segooon@gmail.com>
Date: Sun, 5 Sep 2010 22:32:45 +0400
From: Kulikov Vasiliy <segooon@...il.com>
To: kernel-janitors@...r.kernel.org
Cc: Vasiliy Kulikov <segooon@...il.com>,
Greg Kroah-Hartman <gregkh@...e.de>,
Ernesto Ramos <ernesto@...com>, Nishanth Menon <nm@...com>,
Ivan Gomez Castellanos <ivan.gomez@...com>,
Felipe Contreras <felipe.contreras@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: [PATCH 07/14] staging: tidspbridge: check return code of get_user
From: Vasiliy Kulikov <segooon@...il.com>
Function get_user may fail. Check for it.
Signed-off-by: Vasiliy Kulikov <segooon@...il.com>
---
I couldn't compile this driver at all, so it is not tested.
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 b23591b..faf8304 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);
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists