diff options
| author | Miaoqian Lin <linmq006@gmail.com> | 2025-10-29 15:17:58 +0800 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2025-11-06 13:12:33 +0000 |
| commit | 1a58d865f423f4339edf59053e496089075fa950 (patch) | |
| tree | 5900b797723b0d2b8ac1c52fce651d3e8395dfb8 /net/unix/af_unix.c | |
| parent | 6b6eddc63ce871897d3a5bc4f8f593e698aef104 (diff) | |
ASoC: sdw_utils: fix device reference leak in is_sdca_endpoint_present()
The bus_find_device_by_name() function returns a device pointer with an
incremented reference count, but the original code was missing put_device()
calls in some return paths, leading to reference count leaks.
Fix this by ensuring put_device() is called before function exit after
bus_find_device_by_name() succeeds
This follows the same pattern used elsewhere in the kernel where
bus_find_device_by_name() is properly paired with put_device().
Found via static analysis and code review.
Fixes: 4f8ef33dd44a ("ASoC: soc_sdw_utils: skip the endpoint that doesn't present")
Cc: stable@vger.kernel.org
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://patch.msgid.link/20251029071804.8425-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'net/unix/af_unix.c')
0 files changed, 0 insertions, 0 deletions
