fix undefined reference to user_shm_unlock
[linux-flexiantxendom0-natty.git] / ipc / shm.c
index 1bc4701..30162a5 100644 (file)
--- a/ipc/shm.c
+++ b/ipc/shm.c
@@ -410,7 +410,7 @@ static int newseg(struct ipc_namespace *ns, struct ipc_params *params)
        return error;
 
 no_id:
-       if (shp->mlock_user)    /* shmflg & SHM_HUGETLB case */
+       if (is_file_hugepages(file) && shp->mlock_user)
                user_shm_unlock(size, shp->mlock_user);
        fput(file);
 no_file: