lkml.org 
[lkml]   [2005]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[patch 8/8] drivers/isdn/pcbit/* - compile warning cleanup
From
Date

compile warning cleanup - handle copy_to/from_user error
returns

Signed-off-by: Stephen Biggs <yrgrknmxpzlk@gawab.com>
Signed-off-by: Domen Puncer <domen@coderock.org>
---

kj-domen/drivers/isdn/pcbit/drv.c | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff -puN drivers/isdn/pcbit/drv.c~return_code-drivers_isdn_pcbit drivers/isdn/pcbit/drv.c
--- kj/drivers/isdn/pcbit/drv.c~return_code-drivers_isdn_pcbit 2005-03-05 16:13:08.000000000 +0100
+++ kj-domen/drivers/isdn/pcbit/drv.c 2005-03-05 16:13:08.000000000 +0100
@@ -727,23 +727,26 @@ int pcbit_stat(u_char __user *buf, int l

if (stat_st < stat_end)
{
- copy_to_user(buf, statbuf + stat_st, len);
+ if (copy_to_user(buf, statbuf + stat_st, len))
+ return -EFAULT;
stat_st += len;
}
else
{
if (len > STATBUF_LEN - stat_st)
{
- copy_to_user(buf, statbuf + stat_st,
- STATBUF_LEN - stat_st);
- copy_to_user(buf, statbuf,
- len - (STATBUF_LEN - stat_st));
+ if (copy_to_user(buf, statbuf + stat_st,
+ STATBUF_LEN - stat_st) ||
+ copy_to_user(buf, statbuf,
+ len - (STATBUF_LEN - stat_st)))
+ return -EFAULT;

stat_st = len - (STATBUF_LEN - stat_st);
}
else
{
- copy_to_user(buf, statbuf + stat_st, len);
+ if (copy_to_user(buf, statbuf + stat_st, len))
+ return -EFAULT;

stat_st += len;

_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 14:10    [from the cache]
©2003-2011 Jasper Spaans