summaryrefslogtreecommitdiff
path: root/xpp/xpp_zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/xpp_zap.c')
-rw-r--r--xpp/xpp_zap.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c
index ffb8934..33ec4c6 100644
--- a/xpp/xpp_zap.c
+++ b/xpp/xpp_zap.c
@@ -716,8 +716,7 @@ int proc_sync_read(char *page, char **start, off_t off, int count, int *eof, voi
static int proc_sync_write(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
- const int NUM_SIZE = 100;
- char buf[NUM_SIZE];
+ char buf[MAX_PROC_WRITE];
int xbus_num;
int xpd_num;
xbus_t *xbus;
@@ -726,7 +725,7 @@ static int proc_sync_write(struct file *file, const char __user *buffer, unsigne
bool setit;
// DBG("%s: count=%ld\n", __FUNCTION__, count);
- if(count >= NUM_SIZE)
+ if(count >= MAX_PROC_WRITE)
return -EINVAL;
if(copy_from_user(buf, buffer, count))
return -EFAULT;
@@ -793,13 +792,12 @@ int proc_xpd_ztregister_read(char *page, char **start, off_t off, int count, int
static int proc_xpd_ztregister_write(struct file *file, const char __user *buffer, unsigned long count, void *data)
{
xpd_t *xpd = data;
- const int NUM_SIZE = 100;
- char buf[NUM_SIZE];
+ char buf[MAX_PROC_WRITE];
bool zt_reg;
int ret;
BUG_ON(!xpd);
- if(count >= NUM_SIZE)
+ if(count >= MAX_PROC_WRITE)
return -EINVAL;
if(copy_from_user(buf, buffer, count))
return -EFAULT;
@@ -1103,7 +1101,7 @@ int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg)
switch (cmd) {
case ZT_ONHOOKTRANSFER:
- if (get_user(x, (int *)arg))
+ if (get_user(x, (int __user *)arg))
return -EFAULT;
xpd->ohttimer[pos] = x << 3;
xpd->idletxhookstate[pos] = FXS_LINE_CID; /* OHT mode when idle */
@@ -1114,7 +1112,7 @@ int xpp_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long arg)
DBG("xpd=%d: ZT_ONHOOKTRANSFER (%d millis) chan=%d\n", xpd->id, x, pos);
return -ENOTTY;
case ZT_TONEDETECT:
- if (get_user(x, (int *)arg))
+ if (get_user(x, (int __user *)arg))
return -EFAULT;
DBG("xpd=%d: ZT_TONEDETECT chan=%d: TONEDETECT_ON=%d TONEDETECT_MUTE=%d\n",
xpd->id, pos, (x & ZT_TONEDETECT_ON), (x & ZT_TONEDETECT_MUTE));