lkml.org 
[lkml]   [2016]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm: mlock: check if vma is locked using & instead of && operator
Date
From: Colin Ian King <colin.king@canonical.com>

The check to see if a vma is locked is using the operator && and
should be using the bitwise operator & to see if the VM_LOCKED bit
is set. Fix this to use & instead.

Fixes: ae38c3be005ee ("mm: mlock: check against vma for actual mlock() size")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
mm/mlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mlock.c b/mm/mlock.c
index fafbb78..f5b1d07 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -643,7 +643,7 @@ static int count_mm_mlocked_page_nr(struct mm_struct *mm,
for (; vma ; vma = vma->vm_next) {
if (start + len <= vma->vm_start)
break;
- if (vma->vm_flags && VM_LOCKED) {
+ if (vma->vm_flags & VM_LOCKED) {
if (start > vma->vm_start)
count -= (start - vma->vm_start);
if (start + len < vma->vm_end) {
--
2.9.3
\
 
 \ /
  Last update: 2016-09-17 09:59    [W:0.053 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site