patch-2.4.0-test4 linux/drivers/sgi/char/shmiq.c
Next file: linux/drivers/sgi/char/streamable.c
Previous file: linux/drivers/sgi/char/graphics.c
Back to the patch index
Back to the overall index
- Lines: 22
- Date:
Wed Jul 12 21:58:43 2000
- Orig file:
v2.4.0-test3/linux/drivers/sgi/char/shmiq.c
- Orig date:
Mon Jul 10 16:47:24 2000
diff -u --recursive --new-file v2.4.0-test3/linux/drivers/sgi/char/shmiq.c linux/drivers/sgi/char/shmiq.c
@@ -329,9 +329,12 @@
size = vma->vm_end - vma->vm_start;
start = vma->vm_start;
+ lock_kernel();
mem = (unsigned long) shmiqs [minor].shmiq_vaddr = vmalloc_uncached (size);
- if (!mem)
+ if (!mem) {
+ unlock_kernel();
return -EINVAL;
+ }
/* Prevent the swapper from considering these pages for swap and touching them */
vma->vm_flags |= (VM_SHM | VM_LOCKED | VM_IO);
@@ -345,6 +348,7 @@
shmiqs [minor].tail = 0;
/* Init the shared memory input queue */
memset (shmiqs [minor].shmiq_vaddr, 0, size);
+ unlock_kernel();
return error;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)