* [patch 8/8] drivers/isdn/pcbit/* - compile warning cleanup
@ 2005-03-06 22:38 domen
0 siblings, 0 replies; only message in thread
From: domen @ 2005-03-06 22:38 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, isdn4linux, domen, yrgrknmxpzlk
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;
_
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-03-06 23:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-06 22:38 [patch 8/8] drivers/isdn/pcbit/* - compile warning cleanup domen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®