lkml.org 
[lkml]   [2012]   [Apr]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 1/1] mmap.c: find_vma: remove unnecessary if(mm) check
On Sat, 21 Apr 2012 19:12:35 +0530
Rajman Mekaco <rajman.mekaco@gmail.com> wrote:

> The if(mm) check is not required in find_vma, as the kernel
> code calls find_vma only when it is absolutely sure that the
> mm_struct arg to it is non-NULL.
>
> Removing the if(mm) check and adding the a WARN_ONCE(!mm)
> for now.

Lets do this as well:

--- a/mm/mmap.c~mm-mmapc-find_vma-remove-unnecessary-ifmm-check-fix
+++ a/mm/mmap.c
@@ -1639,7 +1639,7 @@ struct vm_area_struct *find_vma(struct m
{
struct vm_area_struct *vma = NULL;

- if (WARN_ON_ONCE(!mm))
+ if (WARN_ON_ONCE(!mm)) /* Remove this in linux-3.6 */
return NULL;

/* Check the cache first. */


\
 
 \ /
  Last update: 2012-04-23 23:43    [W:2.078 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site