summaryrefslogtreecommitdiff
path: root/linux-core/sis_drv.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-core/sis_drv.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-core/sis_drv.c')
-rw-r--r--linux-core/sis_drv.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/linux-core/sis_drv.c b/linux-core/sis_drv.c
index 2f98e322..92ec32dd 100644
--- a/linux-core/sis_drv.c
+++ b/linux-core/sis_drv.c
@@ -250,7 +250,7 @@ static int sis_takedown(drm_device_t *dev)
drm_free(temp, sizeof(*temp), DRM_MEM_AGPLISTS);
temp = temp_next;
}
- if (dev->agp->acquired) (*drm_agp.release)();
+ if (dev->agp->acquired) _drm_agp_release();
}
#endif
/* Clear vma list (only built for debugging) */
@@ -394,17 +394,16 @@ int sis_version(struct inode *inode, struct file *filp, unsigned int cmd,
drm_version_t version;
int len;
- copy_from_user_ret(&version,
- (drm_version_t *)arg,
- sizeof(version),
- -EFAULT);
+ if (copy_from_user(&version, (drm_version_t *)arg, sizeof(version)))
+ return -EFAULT;
#define DRM_COPY(name,value) \
len = strlen(value); \
if (len > name##_len) len = name##_len; \
name##_len = strlen(value); \
if (len && name) { \
- copy_to_user_ret(name, value, len, -EFAULT); \
+ if (copy_to_user(name, value, len)) \
+ return -EFAULT; \
}
version.version_major = SIS_MAJOR;
@@ -415,10 +414,8 @@ int sis_version(struct inode *inode, struct file *filp, unsigned int cmd,
DRM_COPY(version.date, SIS_DATE);
DRM_COPY(version.desc, SIS_DESC);
- copy_to_user_ret((drm_version_t *)arg,
- &version,
- sizeof(version),
- -EFAULT);
+ if (copy_to_user((drm_version_t *)arg, &version, sizeof(version)))
+ return -EFAULT;
return 0;
}
@@ -533,7 +530,8 @@ int sis_lock(struct inode *inode, struct file *filp, unsigned int cmd,
dev->lck_start = start = get_cycles();
#endif
- copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+ if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock)))
+ return -EFAULT;
if (lock.context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",
@@ -667,7 +665,8 @@ int sis_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
drm_device_t *dev = priv->dev;
drm_lock_t lock;
- copy_from_user_ret(&lock, (drm_lock_t *)arg, sizeof(lock), -EFAULT);
+ if (copy_from_user(&lock, (drm_lock_t *)arg, sizeof(lock)))
+ return -EFAULT;
if (lock.context == DRM_KERNEL_CONTEXT) {
DRM_ERROR("Process %d using kernel context %d\n",