patch-2.4.0-test2 linux/drivers/char/drm/bufs.c
Next file: linux/drivers/char/drm/drmP.h
Previous file: linux/drivers/char/drm/Makefile
Back to the patch index
Back to the overall index
- Lines: 25
- Date:
Wed Jun 21 10:10:02 2000
- Orig file:
v2.4.0-test1/linux/drivers/char/drm/bufs.c
- Orig date:
Sun Mar 19 18:35:30 2000
diff -u --recursive --new-file v2.4.0-test1/linux/drivers/char/drm/bufs.c linux/drivers/char/drm/bufs.c
@@ -72,11 +72,13 @@
switch (map->type) {
case _DRM_REGISTERS:
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)) {
@@ -478,8 +480,10 @@
-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;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)