Commit 2b6ffcd
net: stmmac: restructure the error path of stmmac_probe_config_dt()
Current implementation of stmmac_probe_config_dt() does not release the
OF node reference obtained by of_parse_phandle() in some error paths.
The problem is that some error paths call stmmac_remove_config_dt() to
clean up but others use and unwind ladder. These two types of error
handling have not kept in sync and have been a recurring source of bugs.
Re-write the error handling in stmmac_probe_config_dt() to use an unwind
ladder. Consequently, stmmac_remove_config_dt() is not needed anymore,
thus remove it.
This bug was found by an experimental verification tool that I am
developing.
Fixes: 4838a54 ("net: stmmac: Fix wrapper drivers not detecting PHY")
Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Link: https://patch.msgid.link/20241219024119.2017012-1-joe@pf.is.s.u-tokyo.ac.jp
Signed-off-by: Jakub Kicinski <kuba@kernel.org>1 parent a072ffd commit 2b6ffcd
1 file changed
+17
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
405 | 405 | | |
406 | 406 | | |
407 | 407 | | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | 408 | | |
425 | 409 | | |
426 | 410 | | |
| |||
490 | 474 | | |
491 | 475 | | |
492 | 476 | | |
493 | | - | |
494 | | - | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
495 | 481 | | |
496 | 482 | | |
497 | 483 | | |
| |||
581 | 567 | | |
582 | 568 | | |
583 | 569 | | |
584 | | - | |
585 | | - | |
| 570 | + | |
| 571 | + | |
586 | 572 | | |
587 | 573 | | |
588 | 574 | | |
| |||
610 | 596 | | |
611 | 597 | | |
612 | 598 | | |
613 | | - | |
614 | | - | |
| 599 | + | |
| 600 | + | |
615 | 601 | | |
616 | 602 | | |
617 | 603 | | |
| |||
663 | 649 | | |
664 | 650 | | |
665 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
666 | 656 | | |
667 | 657 | | |
668 | 658 | | |
| |||
671 | 661 | | |
672 | 662 | | |
673 | 663 | | |
674 | | - | |
675 | | - | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
676 | 668 | | |
677 | 669 | | |
678 | 670 | | |
679 | 671 | | |
680 | 672 | | |
681 | 673 | | |
682 | | - | |
683 | | - | |
| 674 | + | |
684 | 675 | | |
685 | 676 | | |
686 | 677 | | |
| |||
0 commit comments