halow: don't print version info that was never read - #3
Open
ericrwx wants to merge 1 commit into
Open
Conversation
Problem: when mmwlan_get_version() fails, mmhalow_print_version_info()
logs the error and then prints `version` anyway -- an uninitialized stack
struct. The reported morselib/firmware strings are whatever the stack held
and the chip ID typically comes out as 0x0000, so the symptom looks like a
dead SPI bus or an absent transceiver rather than a failed read. That
misdirects the reader into a hardware investigation.
Reproduce:
1. Make mmwlan_boot() fail, so the transceiver never boots.
2. Call mmhalow_print_version_info() (mmhalow_init() does so
unconditionally).
Observed: "Error occured whilst retrieving version info - 3" followed by
"Morse chip ID: 0x0000" and garbage version strings.
Expected: the error alone, with no fabricated values after it.
Fix: return after logging the error, closing the separator line first so
the block stays balanced.
Verified: on hardware the spurious 0x0000 chip ID no longer appears; the
failure is reported exactly once.
Signed-off-by: Eric Wang <eric@rwx.one>
ericrwx
force-pushed
the
fix-uninit-version-print
branch
from
July 30, 2026 01:27
b2ec468 to
cea168a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
When mmwlan_get_version() fails, mmhalow_print_version_info() logs the error and then prints
versionanyway -- an uninitialized stack struct. The reported morselib/firmware strings are whatever the stack held and the chip ID typically comes out as 0x0000, so the symptom looks like a dead SPI bus or an absent transceiver rather than a failed read. That misdirects the reader into a hardware investigation.Steps to Reproduce:
Fix:
Test Plan: