Skip to content

Commit 6daf4e8

Browse files
committed
pstore/ram: Move pmsg init earlier
Since the ftrace area can vary in size based on CPU count, move pmsg initialization earlier so it will have a stable location. Suggested-by: Paramjit Oberoi <pso@chromium.org> Cc: Anton Vorontsov <anton@enomsg.org> Cc: Colin Cross <ccross@android.com> Cc: Tony Luck <tony.luck@intel.com> Signed-off-by: Kees Cook <keescook@chromium.org> Reviewed: Guilherme G. Piccoli <gpiccoli@igalia.com> Link: https://lore.kernel.org/r/20221011200112.731334-3-keescook@chromium.org
1 parent 3219122 commit 6daf4e8

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

fs/pstore/ram.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,11 @@ static int ramoops_probe(struct platform_device *pdev)
785785
if (err)
786786
goto fail_init;
787787

788+
err = ramoops_init_prz("pmsg", dev, cxt, &cxt->mprz, &paddr,
789+
cxt->pmsg_size, 0);
790+
if (err)
791+
goto fail_init;
792+
788793
cxt->max_ftrace_cnt = (cxt->flags & RAMOOPS_FLAG_FTRACE_PER_CPU)
789794
? nr_cpu_ids
790795
: 1;
@@ -796,11 +801,6 @@ static int ramoops_probe(struct platform_device *pdev)
796801
if (err)
797802
goto fail_init;
798803

799-
err = ramoops_init_prz("pmsg", dev, cxt, &cxt->mprz, &paddr,
800-
cxt->pmsg_size, 0);
801-
if (err)
802-
goto fail_init;
803-
804804
cxt->pstore.data = cxt;
805805
/*
806806
* Prepare frontend flags based on which areas are initialized.

0 commit comments

Comments
 (0)