mm: Add NULL check before de-referencing vma
authorBharat Nihalani <bnihalani@nvidia.com>
Tue, 24 Jun 2014 10:15:10 +0000 (15:15 +0530)
committerHarshada Kale <hkale@nvidia.com>
Thu, 26 Jun 2014 16:32:29 +0000 (09:32 -0700)
commit72988f78bb521e1c4cfe17c02271d2837a66bf04
treee093814d0600d0e8acba06d9750ca9f2adf63069
parent8b0376e7bf00b8b5baad201097217b3b78b3313c
mm: Add NULL check before de-referencing vma

This prevents the following crash seen during boot-up:
Unable to handle kernel NULL pointer dereference at virtual address 00000041
pgd = ffffffc037f68000
[00000041] *pgd=0000000000000000
Internal error: Oops: 96000005 [#1] PREEMPT SMP
Modules linked in: inv_bmp180 inv_ak8975 inv_mpu
CPU: 0 PID: 1457 Comm: IntentService[F Not tainted 3.10.40-g4abcb3f #1
task: ffffffc0393e0080 ti: ffffffc0393e8000 task.ti: ffffffc0393e8000
PC is at follow_page_mask+0x1c/0x378
LR is at __get_user_pages.part.88+0x124/0x700
pc : [<ffffffc00016c314>] lr : [<ffffffc00016e1d4>] pstate: 40000045

Bug 1525355

Change-Id: Ieed6942d7beb32964484f97d5cc671b42c4b60cb
Signed-off-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-on: http://git-master/r/427723
Tested-by: Vandana Salve <vsalve@nvidia.com>
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>
mm/memory.c