]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mmap.c:insert_vm_struct(): check for failure before setting values
authorChen Gang <gang.chen.5i5j@gmail.com>
Tue, 8 Sep 2015 22:04:08 +0000 (15:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2015 22:35:28 +0000 (15:35 -0700)
commitb2ed7b187f71c69ecef3fa683715e0ae009aab49
tree566dafe703c73afee482b789602efd8426833783
parent4b6fcded2fb96454a304b80198f63e8e17435961
mm/mmap.c:insert_vm_struct(): check for failure before setting values

There's no point in initializing vma->vm_pgoff if the insertion attempt
will be failing anyway.  Run the checks before performing the
initialization.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c