Skip to content

atm: idt77252: shut down tst timer on probe failure - #3

Open
g4tkey wants to merge 1 commit into
linux-netdev:mainfrom
g4tkey:fix-idt77252-tst-timer-teardown
Open

atm: idt77252: shut down tst timer on probe failure#3
g4tkey wants to merge 1 commit into
linux-netdev:mainfrom
g4tkey:fix-idt77252-tst-timer-teardown

Conversation

@g4tkey

@g4tkey g4tkey commented Jul 28, 2026

Copy link
Copy Markdown

Summary

  • shut down tst_timer before probe error teardown
  • prevent the timer callback from accessing freed idt77252_dev state

Details

init_card() calls fill_tst(), which can arm tst_timer. If the later
idt77252_dev_open() call fails, probe reaches err_out_deinit_card, releases
card resources, and frees card without first stopping the timer.

timer_shutdown_sync() is safe on earlier paths to the same label because the
timer is initialized before those paths.

Validation

  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings
  • reviewed the call chain from init_card() through fill_tst()/mod_timer()
  • not hardware tested (legacy IDT77252 ATM hardware unavailable)

This issue was found by a static analysis tool.

init_card() calls fill_tst(), which arms tst_timer to switch the
transmit schedule table. If the subsequent idt77252_dev_open() call
fails, probe tears down the card and frees its memory while the timer
may still be pending or running.

Shut down the timer synchronously before deinitializing the card so the
callback cannot access released card resources or be rearmed during
teardown. The timer is initialized before every path to this error
label, so shutting it down is also safe for earlier probe failures.

This issue was found by a static analysis tool.

Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
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