Commit 28a265a
ASoC: mediatek: Fix error handling in mt8183_da7219_max98357_dev_probe
The device_node pointer is returned by of_parse_phandle() with refcount
incremented. We should use of_node_put() on it when done.
This function only calls of_node_put() in the regular path.
And it will cause refcount leak in error paths.
Fix this by calling of_node_put() in error handling too.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220316014059.19292-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 740dc3e commit 28a265a
1 file changed
Lines changed: 16 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
698 | | - | |
699 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
700 | 703 | | |
701 | 704 | | |
702 | 705 | | |
| |||
761 | 764 | | |
762 | 765 | | |
763 | 766 | | |
764 | | - | |
| 767 | + | |
| 768 | + | |
765 | 769 | | |
766 | 770 | | |
767 | 771 | | |
768 | | - | |
769 | | - | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
770 | 776 | | |
771 | 777 | | |
772 | 778 | | |
| |||
775 | 781 | | |
776 | 782 | | |
777 | 783 | | |
778 | | - | |
| 784 | + | |
779 | 785 | | |
780 | 786 | | |
781 | 787 | | |
782 | 788 | | |
783 | | - | |
| 789 | + | |
| 790 | + | |
784 | 791 | | |
| 792 | + | |
| 793 | + | |
785 | 794 | | |
786 | 795 | | |
787 | 796 | | |
| |||
0 commit comments