diff options
| author | Takashi Iwai <tiwai@suse.de> | 2026-10-07 19:25:24 +0200 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-08 08:47:47 +0200 |
| commit | 344e74ac50aff89674a1bea153f008bfb31ed952 (patch) | |
| tree | cd5fffaf450230c110d2cddcf6205b4e8c32dc35 /tools/lib/python/kdoc/python_version.py | |
| parent | f7faf5d9b5668919cae84a6247f8f7b4e2c0227c (diff) | |
ALSA: core: Fix leaks at snd_card_init() error paths
When the snd_card object is initialized internally in snd_card_init(),
the error path of card->value_buf allocation returns straightly as an
error without invoking the destructor, which would leak resources.
Also, the other error paths in snd_card_init() release the card object
only via put_device(), and this misses the cleanups that are done in
snd_card_disconnect(); namely, the reserved slot bit in snd_cards_lock
is never cleared, so the card index remains occupied, and the debugfs
directory created for the card is left over.
Fix them by calling snd_card_free() at the error path, which performs
both the disconnection and the release properly. As snd_card_free()
calls snd_device_free_all() internally, the explicit call is dropped,
and the error labels are unified.
Fixes: 84446536f63d ("ALSA: control: Verify put() result when in debug mode")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20261007172533.14667-7-tiwai@suse.de
Diffstat (limited to 'tools/lib/python/kdoc/python_version.py')
0 files changed, 0 insertions, 0 deletions
