linux/tools/testing
Malaya Kumar Rout cb89f0c1ae selftests/alsa: Fix memory leak in find_controls error path
In find_controls(), card_data is allocated with malloc() but when
snd_ctl_open_lconf() fails, the code jumps to next_card without
freeing the allocated memory. This results in a memory leak for
each card where snd_ctl_open_lconf() fails.

Add free(card_data) before goto next_card to ensure proper cleanup
of the allocated memory in the error path.

Fixes: 5aaf9efffc ("kselftest: alsa: Add simplistic test for ALSA mixer controls kselftest")
Signed-off-by: Malaya Kumar Rout <malayarout91@gmail.com>
Link: https://patch.msgid.link/20260704105736.94874-1-malayarout91@gmail.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2026-07-05 09:36:41 +02:00
..
crypto/chacha20-s390 crypto: drbg - Fold include/crypto/drbg.h into crypto/drbg.c 2026-05-07 16:09:59 +08:00
cxl Merge branch 'for-7.2/cxl-type2-attach-region' into cxl-for-next 2026-06-12 13:47:53 -07:00
fault-injection
ktest ktest: Add logfile to failure directory 2026-04-20 15:23:13 -04:00
kunit kunit:tool: Don't write to stdout when it should be disabled 2026-06-07 20:10:30 -06:00
memblock liveupdate: updates for 7.2-rc1 2026-06-21 09:46:14 -07:00
nvdimm
radix-tree MAINTAINERS: update Liam's email address 2026-04-27 05:54:25 -07:00
rbtree
scatterlist
selftests selftests/alsa: Fix memory leak in find_controls error path 2026-07-05 09:36:41 +02:00
shared mm/slab: improve kmem_cache_alloc_bulk 2026-06-03 18:20:43 +02:00
vma mm/vma: eliminate mmap_action->error_hook, introduce error_override 2026-06-04 14:45:00 -07:00
vsock vsock/test: add MSG_PEEK after partial recv test 2026-04-16 19:34:22 -07:00