Re: [PATCH 1/1] mmap.c: find_vma: remove unnecessary if(mm) check

From: KOSAKI Motohiro
Date: Sat Apr 21 2012 - 19:48:51 EST

On Sat, Apr 21, 2012 at 9:42 AM, Rajman Mekaco <rajman.mekaco@xxxxxxxxx> 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.
> This will serve the purpose of mandating that the execution
> context(user-mode/kernel-mode) be known before find_vma is called.
> Also fixed 2 errors in the declaration
> of the rb_node and vma_tmp local variables.
> I was browsing through the internet and read a discussion
> at which discusses removal
> of the validation check within find_vma.
> Since no-one responded, I decided to send this patch with Andrew's
> suggestions.
> Signed-off-by: Rajman Mekaco <rajman.mekaco@xxxxxxxxx>
> Cc: Kautuk Consul <consul.kautuk@xxxxxxxxx>

Acked-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at