MIPS: Do not request resources for crashkernel if one isn't defined
authorMarcin Nowakowski <marcin.nowakowski@imgtec.com>
Wed, 23 Nov 2016 13:43:43 +0000 (14:43 +0100)
committerRalf Baechle <ralf@linux-mips.org>
Tue, 3 Jan 2017 15:34:44 +0000 (16:34 +0100)
When KEXEC is enabled but crashkernel details are not passed through the
kernel commandline unnecessary resources are requested (start==end==0)

Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/14607/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
arch/mips/kernel/setup.c

index f66e5ce505b23db0e666adb727653df71104c5d1..0058feaa65e5078ba466a4995a516318752ea10a 100644 (file)
@@ -672,6 +672,9 @@ static void __init request_crashkernel(struct resource *res)
 {
        int ret;
 
+       if (crashk_res.start == crashk_res.end)
+               return;
+
        ret = request_resource(res, &crashk_res);
        if (!ret)
                pr_info("Reserving %ldMB of memory at %ldMB for crashkernel\n",