From aed8549e91ade1582505ebce50e4a79d99b4436f Mon Sep 17 00:00:00 2001 From: Rik Faith Date: Wed, 19 Jul 2000 18:38:41 +0000 Subject: Sync with Linux 2.4.0-test4 kernel --- linux/bufs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linux/bufs.c') diff --git a/linux/bufs.c b/linux/bufs.c index 011e4241..fd3b1248 100644 --- a/linux/bufs.c +++ b/linux/bufs.c @@ -72,12 +72,14 @@ int drm_addmap(struct inode *inode, struct file *filp, unsigned int cmd, switch (map->type) { case _DRM_REGISTERS: - case _DRM_FRAME_BUFFER: + case _DRM_FRAME_BUFFER: +#ifndef __sparc__ if (map->offset + map->size < map->offset || map->offset < virt_to_phys(high_memory)) { drm_free(map, sizeof(*map), DRM_MEM_MAPS); return -EINVAL; } +#endif #ifdef CONFIG_MTRR if (map->type == _DRM_FRAME_BUFFER || (map->flags & _DRM_WRITE_COMBINING)) { @@ -484,8 +486,10 @@ int drm_mapbufs(struct inode *inode, struct file *filp, unsigned int cmd, -EFAULT); if (request.count >= dma->buf_count) { + down(¤t->mm->mmap_sem); virtual = do_mmap(filp, 0, dma->byte_count, PROT_READ|PROT_WRITE, MAP_SHARED, 0); + up(¤t->mm->mmap_sem); if (virtual > -1024UL) { /* Real error */ retcode = (signed long)virtual; -- cgit v1.2.3