Skip to content

drivers: can: nrf: fix invalid pointer leading to undef behavior #93831

Description

@bjarki-andreasen

Describe the bug

Incorrect device pointer passed to API wrapper, resulting in undefined behavior.

Regression

  • This is a regression.

Steps to reproduce

  1. Build for the nrf54h20dk/nrf54h20/cpuapp with can120 enabled in the devicetree and -DCONFIG_CAN=y
  2. Flash and debug
  3. Observe the configure_hsfll function in can_nrf.c pass the dev (CAN device) to clock_control_get_rate() instead of the AUXPLL device (config->auxpll)
  4. Observe call flow jump into the API implementation in can_nrf.c, and return garbage

Relevant log output

Logs look as expected, the error is "invisible" if not debugging, the behavior is undefined, any changes to the driver, or build options, could cause hard faults.

Impact

Major – Severely degrades functionality; workaround is difficult or unavailable.

Environment

Linux, Zephyr Release 4.2

Additional Context

Fix has already been applied on main, post release 4.2

Metadata

Metadata

Labels

bugThe issue is a bug, or the PR is fixing a bugplatform: nRFNordic nRFxpriority: lowLow impact/importance bug

Type

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions