Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 39755
b: refs/heads/master
c: 7786ce1
h: refs/heads/master
i:
  39753: 7ed6527
  39751: db04d17
v: v3
  • Loading branch information
Jeff Garzik authored and Linus Torvalds committed Oct 17, 2006
1 parent f7fe579 commit b6bdc16
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 04518bfe8eac2e82b476fb2b0093527adc2bc791
refs/heads/master: 7786ce192fc4917fb9b789dd823476ff8fd6cf66
3 changes: 2 additions & 1 deletion trunk/drivers/isdn/capi/capidrv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,8 @@ static int if_readstat(u8 __user *buf, int len, int id, int channel)
}

for (p=buf, count=0; count < len; p++, count++) {
put_user(*card->q931_read++, p);
if (put_user(*card->q931_read++, p))
return -EFAULT;
if (card->q931_read > card->q931_end)
card->q931_read = card->q931_buf;
}
Expand Down
6 changes: 4 additions & 2 deletions trunk/drivers/isdn/hisax/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
count = cs->status_end - cs->status_read + 1;
if (count >= len)
count = len;
copy_to_user(p, cs->status_read, count);
if (copy_to_user(p, cs->status_read, count))
return -EFAULT;
cs->status_read += count;
if (cs->status_read > cs->status_end)
cs->status_read = cs->status_buf;
Expand All @@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
cnt = HISAX_STATUS_BUFSIZE;
else
cnt = count;
copy_to_user(p, cs->status_read, cnt);
if (copy_to_user(p, cs->status_read, cnt))
return -EFAULT;
p += cnt;
cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
count -= cnt;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/isdn/icn/icn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/isdn/isdnloop/isdnloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,8 @@ isdnloop_readstatus(u_char __user *buf, int len, isdnloop_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;
}
Expand Down
16 changes: 10 additions & 6 deletions trunk/drivers/isdn/pcbit/drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -725,23 +725,27 @@ static int pcbit_stat(u_char __user *buf, int len, int driver, int channel)

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))
return -EFAULT;
if (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;

Expand Down

0 comments on commit b6bdc16

Please sign in to comment.