diff options
Diffstat (limited to 'xpp/card_fxo.c')
-rw-r--r-- | xpp/card_fxo.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c index 771676a..ed77684 100644 --- a/xpp/card_fxo.c +++ b/xpp/card_fxo.c @@ -489,7 +489,7 @@ static int FXO_card_ioctl(xpd_t *xpd, int pos, unsigned int cmd, unsigned long a DBG("-- Setting echo registers: \n"); /* first off: check if this span is fxs. If not: -EINVALID */ if (copy_from_user(&echoregs.wctdm_struct, - (struct wctdm_echo_coefs*)arg, sizeof(echoregs.wctdm_struct))) + (struct wctdm_echo_coefs __user *)arg, sizeof(echoregs.wctdm_struct))) return -EFAULT; /* Set the ACIM register */ @@ -990,8 +990,7 @@ static int process_slic_cmdline(xpd_t *xpd, char *cmdline) static int proc_xpd_slic_write(struct file *file, const char __user *buffer, unsigned long count, void *data) { xpd_t *xpd = data; - const int LINE_LEN = 500; - char buf[LINE_LEN]; + char buf[MAX_PROC_WRITE]; char *p; int i; int ret; @@ -999,7 +998,7 @@ static int proc_xpd_slic_write(struct file *file, const char __user *buffer, uns if(!xpd) return -ENODEV; for(i = 0; i < count; /* noop */) { - for(p = buf; p < buf + LINE_LEN; p++) { /* read a line */ + for(p = buf; p < buf + MAX_PROC_WRITE; p++) { /* read a line */ if(i >= count) break; if(get_user(*p, buffer + i)) @@ -1008,7 +1007,7 @@ static int proc_xpd_slic_write(struct file *file, const char __user *buffer, uns if(*p == '\n' || *p == '\r') /* whatever */ break; } - if(p >= buf + LINE_LEN) + if(p >= buf + MAX_PROC_WRITE) return -E2BIG; *p = '\0'; ret = process_slic_cmdline(xpd, buf); |