]> git.baikalelectronics.ru Git - kernel.git/commit
mm: don't call pte_unmap() against an improper pte
authorDaisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Mon, 26 Oct 2009 23:50:23 +0000 (16:50 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Oct 2009 14:39:32 +0000 (07:39 -0700)
commit1e18a1c62dc47af02c8e91b1b9c7cc7d60dfe822
tree0b0a6b6a54c2a80de86426a74367ec4b1f089b61
parentbc7428b01f8995a258a58c3bc4e0efb6a3f86ddd
mm: don't call pte_unmap() against an improper pte

There are some places where we do like:

pte = pte_map();
do {
(do break in some conditions)
} while (pte++, ...);
pte_unmap(pte - 1);

But if the loop breaks at the first loop, pte_unmap() unmaps invalid pte.

This patch is a fix for this problem.

Signed-off-by: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Reviewd-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c