aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hisax/config.c')
-rw-r--r--drivers/isdn/hisax/config.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index e4823ab2b127..785b08554fca 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -631,7 +631,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
631 count = cs->status_end - cs->status_read + 1; 631 count = cs->status_end - cs->status_read + 1;
632 if (count >= len) 632 if (count >= len)
633 count = len; 633 count = len;
634 copy_to_user(p, cs->status_read, count); 634 if (copy_to_user(p, cs->status_read, count))
635 return -EFAULT;
635 cs->status_read += count; 636 cs->status_read += count;
636 if (cs->status_read > cs->status_end) 637 if (cs->status_read > cs->status_end)
637 cs->status_read = cs->status_buf; 638 cs->status_read = cs->status_buf;
@@ -642,7 +643,8 @@ static int HiSax_readstatus(u_char __user *buf, int len, int id, int channel)
642 cnt = HISAX_STATUS_BUFSIZE; 643 cnt = HISAX_STATUS_BUFSIZE;
643 else 644 else
644 cnt = count; 645 cnt = count;
645 copy_to_user(p, cs->status_read, cnt); 646 if (copy_to_user(p, cs->status_read, cnt))
647 return -EFAULT;
646 p += cnt; 648 p += cnt;
647 cs->status_read += cnt % HISAX_STATUS_BUFSIZE; 649 cs->status_read += cnt % HISAX_STATUS_BUFSIZE;
648 count -= cnt; 650 count -= cnt;