aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/mm/cmm.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-10-14 07:58:10 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-10-24 11:17:07 -0400
commit041058a16a71a1257a1c3c19a55d74641912b918 (patch)
treea0754183b0adea5d2eb335438270ff45fd6e1e49 /arch/s390/mm/cmm.c
parent160d378ebc76a796cc16ae873baeed02992f9202 (diff)
s390/cmm: make copy_from_user() invocation provably correct
Get rid of these two warnings: In function 'copy_from_user', inlined from 'cmm_timeout_handler' at arch/s390/mm/cmm.c:310: uaccess.h:303: warning: call to 'copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct In function 'copy_from_user', inlined from 'cmm_pages_handler' at arch/s390/mm/cmm.c:270: uaccess.h:303: warning: call to 'copy_from_user_overflow' declared with attribute warning: copy_from_user() buffer size is not provably correct Change the "len" type to unsigned int, so we can make sure that there is no buffer overflow. This also generates less code. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/mm/cmm.c')
-rw-r--r--arch/s390/mm/cmm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index 9d84a1feefef..76741306af2a 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -257,8 +257,8 @@ static int cmm_pages_handler(ctl_table *ctl, int write, void __user *buffer,
257 size_t *lenp, loff_t *ppos) 257 size_t *lenp, loff_t *ppos)
258{ 258{
259 char buf[16], *p; 259 char buf[16], *p;
260 unsigned int len;
260 long nr; 261 long nr;
261 int len;
262 262
263 if (!*lenp || (*ppos && !write)) { 263 if (!*lenp || (*ppos && !write)) {
264 *lenp = 0; 264 *lenp = 0;
@@ -298,7 +298,7 @@ static int cmm_timeout_handler(ctl_table *ctl, int write, void __user *buffer,
298{ 298{
299 char buf[64], *p; 299 char buf[64], *p;
300 long nr, seconds; 300 long nr, seconds;
301 int len; 301 unsigned int len;
302 302
303 if (!*lenp || (*ppos && !write)) { 303 if (!*lenp || (*ppos && !write)) {
304 *lenp = 0; 304 *lenp = 0;