Skip to content

[PW_SID:1088823] riscv: cpuinfo: Fix NULL dereference and inconsistent error code#1858

Closed
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1088823
Closed

[PW_SID:1088823] riscv: cpuinfo: Fix NULL dereference and inconsistent error code#1858
linux-riscv-bot wants to merge 1 commit into
workflow__riscv__fixesfrom
pw1088823

Conversation

@linux-riscv-bot
Copy link
Copy Markdown

PR for series 1088823 applied to workflow__riscv__fixes

Name: riscv: cpuinfo: Fix NULL dereference and inconsistent error code
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1088823
Version: 1

Fix a potential NULL pointer dereference in c_show() by ensuring
the device tree node returned by of_get_cpu_node() is checked before use.

Also replace a non-standard return value (-1) in
riscv_of_parent_hartid() with -ENODEV to follow Linux kernel
conventions for "not found" error returns.

Both issues improve robustness and consistency with existing RISC-V CPU info handling code.

v2: Add missing Signed-off-by

Signed-off-by: Mohamed Ayman <mohamedaymanworkspace@gmail.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.41 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1142.85 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1700.17 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 25.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 1.65 seconds
Result: WARNING
Output:

CHECK: Alignment should match open parenthesis
#43: FILE: arch/riscv/kernel/cpu.c:353:
+			if (!of_property_read_string(node, "compatible", &compat) &&
+				strcmp(compat, "riscv"))

total: 0 errors, 0 warnings, 1 checks, 26 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit eb812a497e7f ("riscv: cpuinfo: Fix NULL dereference and inconsistent error code") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 0 warnings, 1 checks, 26 lines checked
CHECK: Alignment should match open parenthesis


@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 86.44 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.25 seconds
Result: PASS

@linux-riscv-bot
Copy link
Copy Markdown
Author

Patch 1: "riscv: cpuinfo: Fix NULL dereference and inconsistent error code"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.30 seconds
Result: PASS

@linux-riscv-bot linux-riscv-bot deleted the pw1088823 branch May 7, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants