Skip to content

x86: Check return values for early memory/IO remap calls

Ross Philipson lkml xen-devel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 7 repliesIn review
  2. v12 patches 6 repliesSuperseded

Changes in v2 from the cover letter

- Added notes in comments about why panic() was used in some cases and
the fact that maintainers approved the usage.
- Added pr_fmt macros in changed files to allow proper usage of pr_*
printing macros.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86: Check return values from early_memremap callsarch/x86/kernel/devicetree.c arch/x86/kernel/e820.c arch/x86/kernel/jailhouse.c +5 more+95 -184 replies
2/2x86: Check return values from early_ioremap callsarch/x86/kernel/apic/x2apic_uv_x.c arch/x86/kernel/early_printk.c arch/x86/kernel/vsmp_64.c+7 -02 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJuergen Gross
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/2] x86: Check return values for early memory/IO remap calls

While sending an earlier patch set it was discovered that there are a number of places in early x86 code were the functions early_memremap() and early_ioremap() are called but the returned pointer is not checked for NULL. Since NULL can be returned for a couple of reasons, the return value should be checked for NULL.

This set fixes the places where the checks were missing. It was not always clear what the best failure mode should be when NULL is detected. In modules where other places tended to pr_warn or panic e.g., the same was done for the checks. In other places it was based on how significantly fatal the failure would end up being. The review process may point out places where this should be changed.

Changes in v2:
- Added notes in comments about why panic() was used in some cases and
the fact that maintainers approved the usage.
- Added pr_fmt macros in changed files to allow proper usage of pr_*
printing macros.

Ross Philipson (2):
x86: Check return values from early_memremap calls
x86: Check return values from early_ioremap calls

 arch/x86/kernel/apic/x2apic_uv_x.c |  2 ++
 arch/x86/kernel/devicetree.c       | 13 ++++++++++
 arch/x86/kernel/e820.c             | 12 +++++++--
 arch/x86/kernel/early_printk.c     |  2 ++
 arch/x86/kernel/jailhouse.c        |  6 +++++
 arch/x86/kernel/mpparse.c          | 51 ++++++++++++++++++++++++++++----------
 arch/x86/kernel/setup.c            | 19 +++++++++++---
 arch/x86/kernel/vsmp_64.c          |  3 +++
 arch/x86/xen/enlighten_hvm.c       |  2 ++
 arch/x86/xen/mmu_pv.c              |  8 ++++++
 arch/x86/xen/setup.c               |  2 ++
 11 files changed, 102 insertions(+), 18 deletions(-)
Signature · 1 line
1.8.3.1