diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:49:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-14 19:49:17 -0400 |
commit | 1dcf58d6e6e6eb7ec10e9abc56887b040205b06f (patch) | |
tree | c03e7a25ef13eea62f1547914a76e5c68f3f4c28 /arch/sparc/kernel/mdesc.c | |
parent | 80dcc31fbe55932ac9204daee5f2ebc0c49b6da3 (diff) | |
parent | e4b0db72be2487bae0e3251c22f82c104f7c1cfd (diff) |
Merge branch 'akpm' (patches from Andrew)
Merge first patchbomb from Andrew Morton:
- arch/sh updates
- ocfs2 updates
- kernel/watchdog feature
- about half of mm/
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (122 commits)
Documentation: update arch list in the 'memtest' entry
Kconfig: memtest: update number of test patterns up to 17
arm: add support for memtest
arm64: add support for memtest
memtest: use phys_addr_t for physical addresses
mm: move memtest under mm
mm, hugetlb: abort __get_user_pages if current has been oom killed
mm, mempool: do not allow atomic resizing
memcg: print cgroup information when system panics due to panic_on_oom
mm: numa: remove migrate_ratelimited
mm: fold arch_randomize_brk into ARCH_HAS_ELF_RANDOMIZE
mm: split ET_DYN ASLR from mmap ASLR
s390: redefine randomize_et_dyn for ELF_ET_DYN_BASE
mm: expose arch_mmap_rnd when available
s390: standardize mmap_rnd() usage
powerpc: standardize mmap_rnd() usage
mips: extract logic for mmap_rnd()
arm64: standardize mmap_rnd() usage
x86: standardize mmap_rnd() usage
arm: factor out mmap ASLR into mmap_rnd
...
Diffstat (limited to 'arch/sparc/kernel/mdesc.c')
-rw-r--r-- | arch/sparc/kernel/mdesc.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/sparc/kernel/mdesc.c b/arch/sparc/kernel/mdesc.c index 99632a87e697..26c80e18d7b1 100644 --- a/arch/sparc/kernel/mdesc.c +++ b/arch/sparc/kernel/mdesc.c | |||
@@ -130,26 +130,26 @@ static struct mdesc_mem_ops memblock_mdesc_ops = { | |||
130 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) | 130 | static struct mdesc_handle *mdesc_kmalloc(unsigned int mdesc_size) |
131 | { | 131 | { |
132 | unsigned int handle_size; | 132 | unsigned int handle_size; |
133 | struct mdesc_handle *hp; | ||
134 | unsigned long addr; | ||
133 | void *base; | 135 | void *base; |
134 | 136 | ||
135 | handle_size = (sizeof(struct mdesc_handle) - | 137 | handle_size = (sizeof(struct mdesc_handle) - |
136 | sizeof(struct mdesc_hdr) + | 138 | sizeof(struct mdesc_hdr) + |
137 | mdesc_size); | 139 | mdesc_size); |
138 | 140 | ||
141 | /* | ||
142 | * Allocation has to succeed because mdesc update would be missed | ||
143 | * and such events are not retransmitted. | ||
144 | */ | ||
139 | base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL); | 145 | base = kmalloc(handle_size + 15, GFP_KERNEL | __GFP_NOFAIL); |
140 | if (base) { | 146 | addr = (unsigned long)base; |
141 | struct mdesc_handle *hp; | 147 | addr = (addr + 15UL) & ~15UL; |
142 | unsigned long addr; | 148 | hp = (struct mdesc_handle *) addr; |
143 | |||
144 | addr = (unsigned long)base; | ||
145 | addr = (addr + 15UL) & ~15UL; | ||
146 | hp = (struct mdesc_handle *) addr; | ||
147 | 149 | ||
148 | mdesc_handle_init(hp, handle_size, base); | 150 | mdesc_handle_init(hp, handle_size, base); |
149 | return hp; | ||
150 | } | ||
151 | 151 | ||
152 | return NULL; | 152 | return hp; |
153 | } | 153 | } |
154 | 154 | ||
155 | static void mdesc_kfree(struct mdesc_handle *hp) | 155 | static void mdesc_kfree(struct mdesc_handle *hp) |