Skip to content

Fix magic comparison in TC6LwIP_Service#70

Open
tkummermehr wants to merge 18 commits intomainfrom
fix/magic-comparison-sync
Open

Fix magic comparison in TC6LwIP_Service#70
tkummermehr wants to merge 18 commits intomainfrom
fix/magic-comparison-sync

Conversation

@tkummermehr
Copy link
Copy Markdown
Collaborator

Correct the magic field check logic in TC6LwIP_Service from inequality to equality comparison.

tkummermehr and others added 18 commits August 4, 2023 10:29
TC6Regs_CheckTimers iterates all TC6_MAX_INSTANCES entries of m_reg[]
and calls DoInitialization on each. Slots that no caller has yet
bound via TC6Regs_Init still have pReg->pTC6 == NULL, so the existing
!pReg->initialized guard lets the init sequence run against a NULL
MAC-PHY handle, dereferencing NULL in TC6_Reset / TC6_WriteRegister
on every tick until a real Init arrives. Masked at the default
TC6_MAX_INSTANCES == 1, triggers as soon as a project configures more.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sync branch) (#61)

Co-authored-by: Sven Semmler <Sven@SvenSemmler.org>
…ync branch) (#59)

Co-authored-by: Sven Semmler <Sven@SvenSemmler.org>
Change condition from LWIP_TC6_MAGIC != lw->magic to LWIP_TC6_MAGIC == lw->magic to correctly check initialized instances.
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.

1 participant