summaryrefslogtreecommitdiffstats
path: root/drivers/isdn/icn
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-17 00:10:40 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-17 08:18:49 -0700
commit7786ce192fc4917fb9b789dd823476ff8fd6cf66 (patch)
tree3ec803c1c77ff22bfe6076ea4d90a27f888b4fad /drivers/isdn/icn
parent04518bfe8eac2e82b476fb2b0093527adc2bc791 (diff)
downloadlinux-7786ce192fc4917fb9b789dd823476ff8fd6cf66.tar.bz2
[PATCH] ISDN: check for userspace copy faults
Most of the ISDN ->readstat() implementations needed to check copy_to_user() and put_user() return values. Signed-off-by: Jeff Garzik <jeff@garzik.org> Cc: Karsten Keil <kkeil@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/icn')
-rw-r--r--drivers/isdn/icn/icn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/isdn/icn/icn.c b/drivers/isdn/icn/icn.c
index 6649f8bc9951..730bbd07ebc7 100644
--- a/drivers/isdn/icn/icn.c
+++ b/drivers/isdn/icn/icn.c
@@ -1010,7 +1010,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card * card)
for (p = buf, count = 0; count < len; p++, count++) {
if (card->msg_buf_read == card->msg_buf_write)
return count;
- put_user(*card->msg_buf_read++, p);
+ if (put_user(*card->msg_buf_read++, p))
+ return -EFAULT;
if (card->msg_buf_read > card->msg_buf_end)
card->msg_buf_read = card->msg_buf;
}