summaryrefslogtreecommitdiff
path: root/xpp/card_fxo.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-06 21:25:15 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-06 21:25:15 +0000
commit392e3edc3d7e6d9f9ad1a3dee3a7efa858b9ee41 (patch)
treee89fd31f44eb57ed02f2fc72cd80f0e84520e1d6 /xpp/card_fxo.c
parent274b05030f73aeb95301c619b86edcf3967bba17 (diff)
Fix problems reported by sparse
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1423 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_fxo.c')
-rw-r--r--xpp/card_fxo.c9
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);