Skip to content

Commit ed129cd

Browse files
committed
Merge tag 'mips_fixes_5.10_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Thomas Bogendoerfer: - fix bug preventing booting on several platforms - fix for build error, when modules need has_transparent_hugepage - fix for memleak in alchemy clk setup * tag 'mips_fixes_5.10_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu MIPS: kernel: Fix for_each_memblock conversion MIPS: export has_transparent_hugepage() for modules
2 parents be1dd66 + ac3b57a commit ed129cd

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

arch/mips/alchemy/common/clock.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
152152
{
153153
struct clk_init_data id;
154154
struct clk_hw *h;
155+
struct clk *clk;
155156

156157
h = kzalloc(sizeof(*h), GFP_KERNEL);
157158
if (!h)
@@ -164,7 +165,13 @@ static struct clk __init *alchemy_clk_setup_cpu(const char *parent_name,
164165
id.ops = &alchemy_clkops_cpu;
165166
h->init = &id;
166167

167-
return clk_register(NULL, h);
168+
clk = clk_register(NULL, h);
169+
if (IS_ERR(clk)) {
170+
pr_err("failed to register clock\n");
171+
kfree(h);
172+
}
173+
174+
return clk;
168175
}
169176

170177
/* AUXPLLs ************************************************************/

arch/mips/kernel/setup.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ static void __init bootmem_init(void)
262262
static void __init bootmem_init(void)
263263
{
264264
phys_addr_t ramstart, ramend;
265-
phys_addr_t start, end;
266-
u64 i;
265+
unsigned long start, end;
266+
int i;
267267

268268
ramstart = memblock_start_of_DRAM();
269269
ramend = memblock_end_of_DRAM();
@@ -300,7 +300,7 @@ static void __init bootmem_init(void)
300300

301301
min_low_pfn = ARCH_PFN_OFFSET;
302302
max_pfn = PFN_DOWN(ramend);
303-
for_each_mem_range(i, &start, &end) {
303+
for_each_mem_pfn_range(i, MAX_NUMNODES, &start, &end, NULL) {
304304
/*
305305
* Skip highmem here so we get an accurate max_low_pfn if low
306306
* memory stops short of high memory.

arch/mips/mm/tlb-r4k.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ int has_transparent_hugepage(void)
438438
}
439439
return mask == PM_HUGE_MASK;
440440
}
441+
EXPORT_SYMBOL(has_transparent_hugepage);
441442

442443
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
443444

0 commit comments

Comments
 (0)