Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

bjarki-andreasen
Copy link
Contributor

The can_nrf device driver incorrectly passes its own device driver pointer to a call to clock_control_get_rate() to get the rate of the auxpll. The actual device driver which should be passed to clock_control_get_rate() is the auxpll.

Without this fix, the call jumps to the can_nrf_api and returns garbage (unfortunately it does not hardfault, which is why this issue has not been discovered yet).

The can_nrf device driver incorrectly passes its own device
driver pointer to a call to clock_control_get_rate() to get the
rate of the auxpll. The actual device driver which should be passed
to clock_control_get_rate() is the auxpll.

Without this fix, the call jumps to the can_nrf_api and returns
garbage (unfortunately it does not hardfault, which is why this
issue has not been discovered yet).

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
Copy link

@henrikbrixandersen henrikbrixandersen added the bug The issue is a bug, or the PR is fixing a bug label Jul 14, 2025
@nashif nashif removed the bug The issue is a bug, or the PR is fixing a bug label Jul 15, 2025
@danieldegrasse danieldegrasse removed this from the v4.2.0 milestone Jul 16, 2025
@danieldegrasse danieldegrasse added the backport v4.2-branch Request backport to the v4.2-branch label Jul 16, 2025
@nashif nashif merged commit f5ee52e into zephyrproject-rtos:main Jul 19, 2025
31 checks passed
@kartben kartben added area: ARM64 ARM (64-bit) Architecture backport v4.2-branch Request backport to the v4.2-branch and removed backport v4.2-branch Request backport to the v4.2-branch labels Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ARM64 ARM (64-bit) Architecture area: CAN backport v4.2-branch Request backport to the v4.2-branch platform: nRF Nordic nRFx size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants