diff options
author | Paul Mundt <lethal@linux-sh.org> | 2010-02-16 03:14:04 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2010-02-16 03:14:04 -0500 |
commit | 55cef91a5d553265f03fe159f9fcdfac36902248 (patch) | |
tree | ae0dc74566ef0c8c80390d441ba690b28642b1ba /arch/sh/mm/pmb.c | |
parent | 319c2cc761505ee54a9536c5d0b9c2ee3fb33866 (diff) |
sh: Prevent fixed slot PMB remapping from clobbering boot entries.
The PMB initialization code walks the entries and synchronizes the
software PMB state with the hardware mappings, preserving the slot index.
Unfortunately pmb_alloc() only tested the bit position in the entry map
and failed to set it, resulting in subsequent remaps being able to be
dynamically assigned a slot that trampled an existing boot mapping with
general badness ensuing.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm/pmb.c')
-rw-r--r-- | arch/sh/mm/pmb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index 3c9bf5b5c36f..a06483076a41 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -77,7 +77,7 @@ static struct pmb_entry *pmb_alloc(unsigned long vpn, unsigned long ppn, | |||
77 | if (pos < 0) | 77 | if (pos < 0) |
78 | return ERR_PTR(pos); | 78 | return ERR_PTR(pos); |
79 | } else { | 79 | } else { |
80 | if (test_bit(entry, &pmb_map)) | 80 | if (test_and_set_bit(entry, &pmb_map)) |
81 | return ERR_PTR(-ENOSPC); | 81 | return ERR_PTR(-ENOSPC); |
82 | pos = entry; | 82 | pos = entry; |
83 | } | 83 | } |