[PATCH] Add adm8211 802.11b wireless driver
[pandora-kernel.git] / ipc / shm.c
index d0259e3..a86a3a5 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -268,7 +268,9 @@ static int shm_mmap(struct file * file, struct vm_area_struct * vma)
        if (ret != 0)
                return ret;
        sfd->vm_ops = vma->vm_ops;
+#ifdef CONFIG_MMU
        BUG_ON(!sfd->vm_ops->fault);
+#endif
        vma->vm_ops = &shm_vm_ops;
        shm_open(vma);
 
@@ -714,7 +716,7 @@ asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf)
                        struct user_struct * user = current->user;
                        if (!is_file_hugepages(shp->shm_file)) {
                                err = shmem_lock(shp->shm_file, 1, user);
-                               if (!err{
+                               if (!err && !(shp->shm_perm.mode & SHM_LOCKED)){
                                        shp->shm_perm.mode |= SHM_LOCKED;
                                        shp->mlock_user = user;
                                }