summaryrefslogtreecommitdiff
path: root/linux/sis_mm.c
diff options
context:
space:
mode:
authorRik Faith <faith@alephnull.com>2000-11-15 15:47:51 +0000
committerRik Faith <faith@alephnull.com>2000-11-15 15:47:51 +0000
commit679531e1669085115bac5f6fc982d54a4a9608e8 (patch)
treefb11ac227a9c2b02cdca70210ec86716892b66ca /linux/sis_mm.c
parent0636342ef84da23f30b838b4f933e3aa15d5c2ce (diff)
Sync with Linux 2.4.0-test11-pre5 Provide backward compatibility tested
against 2.2.18pre21 As usual, since all 2.4.0-test* kernels set LINUX_VERSION_CODE to the same value, if you are running a 2.4.0-test kernel, you MUST be running 2.4.0-test11-pre4 or later (although anything after 2.4.0-test11-pre1 should work fine -- I tested with pre4/pre5). I expect 2.2.x support to continue to work for all recent kernels, but I tested with 2.2.18pre21 -- we use the old intermodule symbol communication for 2.2.x kernels, so they should all continue to work.
Diffstat (limited to 'linux/sis_mm.c')
-rw-r--r--linux/sis_mm.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/linux/sis_mm.c b/linux/sis_mm.c
index 9a8f83ea..4c2b5a6c 100644
--- a/linux/sis_mm.c
+++ b/linux/sis_mm.c
@@ -78,7 +78,8 @@ int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
struct sis_memreq req;
int retval = 0;
- copy_from_user_ret(&fb, (drm_sis_mem_t *)arg, sizeof(fb), -EFAULT);
+ if (copy_from_user(&fb, (drm_sis_mem_t *)arg, sizeof(fb)))
+ return -EFAULT;
req.size = fb.size;
sis_malloc(&req);
@@ -98,7 +99,7 @@ int sis_fb_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
fb.free = 0;
}
- copy_to_user_ret((drm_sis_mem_t *)arg, &fb, sizeof(fb), -EFAULT);
+ if (copy_to_user((drm_sis_mem_t *)arg, &fb, sizeof(fb))) return -EFAULT;
DRM_DEBUG("alloc fb, size = %d, offset = %ld\n", fb.size, req.offset);
@@ -111,7 +112,8 @@ int sis_fb_free(struct inode *inode, struct file *filp, unsigned int cmd,
drm_sis_mem_t fb;
int retval = 0;
- copy_from_user_ret(&fb, (drm_sis_mem_t *)arg, sizeof(fb), -EFAULT);
+ if (copy_from_user(&fb, (drm_sis_mem_t *)arg, sizeof(fb)))
+ return -EFAULT;
if(!fb.free){
return -1;
@@ -152,7 +154,8 @@ int sis_agp_init(struct inode *inode, struct file *filp, unsigned int cmd,
{
drm_sis_agp_t agp;
- copy_from_user_ret(&agp, (drm_sis_agp_t *)arg, sizeof(agp), -EFAULT);
+ if (copy_from_user(&agp, (drm_sis_agp_t *)arg, sizeof(agp)))
+ return -EFAULT;
AgpHeap = mmInit(agp.offset, agp.size);
@@ -171,7 +174,8 @@ int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
if(!AgpHeap)
return -1;
- copy_from_user_ret(&agp, (drm_sis_mem_t *)arg, sizeof(agp), -EFAULT);
+ if (copy_from_user(&agp, (drm_sis_mem_t *)arg, sizeof(agp)))
+ return -EFAULT;
block = mmAllocMem(AgpHeap, agp.size, 0, 0);
if(block){
@@ -190,7 +194,7 @@ int sis_agp_alloc(struct inode *inode, struct file *filp, unsigned int cmd,
agp.free = 0;
}
- copy_to_user_ret((drm_sis_mem_t *)arg, &agp, sizeof(agp), -EFAULT);
+ if (copy_to_user((drm_sis_mem_t *)arg, &agp, sizeof(agp))) return -EFAULT;
DRM_DEBUG("alloc agp, size = %d, offset = %d\n", agp.size, agp.offset);
@@ -206,7 +210,8 @@ int sis_agp_free(struct inode *inode, struct file *filp, unsigned int cmd,
if(!AgpHeap)
return -1;
- copy_from_user_ret(&agp, (drm_sis_mem_t *)arg, sizeof(agp), -EFAULT);
+ if (copy_from_user(&agp, (drm_sis_mem_t *)arg, sizeof(agp)))
+ return -EFAULT;
if(!agp.free){
return -1;