Commit 578ccfe
ASoC: codecs: wcd937x: Fix error handling in wcd937x codec driver
In wcd937x_bind(), the driver calls of_sdw_find_device_by_node() to
obtain references to RX and TX SoundWire devices, which increment the
device reference counts. However, the corresponding put_device() are
missing in both the error paths and the normal unbind path in
wcd937x_unbind().
Add proper error handling with put_device() calls in all error paths
of wcd937x_bind() and ensure devices are released in wcd937x_unbind().
Found by code review.
Cc: stable@vger.kernel.org
Fixes: 772ed12 ("ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Reviewed-by: David Heidelberg <david@ixit.cz>
Link: https://patch.msgid.link/20251116061623.11830-1-make24@iscas.ac.cn
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 6a23ae0 commit 578ccfe
1 file changed
Lines changed: 34 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2748 | 2748 | | |
2749 | 2749 | | |
2750 | 2750 | | |
2751 | | - | |
| 2751 | + | |
| 2752 | + | |
2752 | 2753 | | |
2753 | 2754 | | |
2754 | 2755 | | |
| |||
2757 | 2758 | | |
2758 | 2759 | | |
2759 | 2760 | | |
2760 | | - | |
| 2761 | + | |
| 2762 | + | |
2761 | 2763 | | |
2762 | 2764 | | |
2763 | 2765 | | |
2764 | 2766 | | |
2765 | 2767 | | |
2766 | 2768 | | |
2767 | 2769 | | |
2768 | | - | |
| 2770 | + | |
| 2771 | + | |
2769 | 2772 | | |
2770 | 2773 | | |
2771 | 2774 | | |
| |||
2775 | 2778 | | |
2776 | 2779 | | |
2777 | 2780 | | |
2778 | | - | |
| 2781 | + | |
| 2782 | + | |
2779 | 2783 | | |
2780 | 2784 | | |
2781 | 2785 | | |
2782 | 2786 | | |
2783 | 2787 | | |
2784 | | - | |
| 2788 | + | |
| 2789 | + | |
2785 | 2790 | | |
2786 | 2791 | | |
2787 | 2792 | | |
2788 | 2793 | | |
2789 | 2794 | | |
2790 | | - | |
| 2795 | + | |
| 2796 | + | |
2791 | 2797 | | |
2792 | 2798 | | |
2793 | 2799 | | |
2794 | 2800 | | |
2795 | 2801 | | |
2796 | | - | |
| 2802 | + | |
| 2803 | + | |
2797 | 2804 | | |
2798 | 2805 | | |
2799 | 2806 | | |
2800 | 2807 | | |
2801 | 2808 | | |
2802 | | - | |
| 2809 | + | |
2803 | 2810 | | |
2804 | 2811 | | |
2805 | 2812 | | |
| |||
2809 | 2816 | | |
2810 | 2817 | | |
2811 | 2818 | | |
2812 | | - | |
| 2819 | + | |
2813 | 2820 | | |
| 2821 | + | |
| 2822 | + | |
2814 | 2823 | | |
2815 | 2824 | | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
2816 | 2839 | | |
2817 | 2840 | | |
2818 | 2841 | | |
| |||
2825 | 2848 | | |
2826 | 2849 | | |
2827 | 2850 | | |
| 2851 | + | |
| 2852 | + | |
2828 | 2853 | | |
2829 | 2854 | | |
2830 | 2855 | | |
| |||
0 commit comments