]> git.hungrycats.org Git - linux/commit
ALSA: control: Use scoped cleanup for user control buffers
authorCássio Gabriel <cassiogabrielcontato@gmail.com>
Thu, 4 Jun 2026 04:48:12 +0000 (01:48 -0300)
committerTakashi Iwai <tiwai@suse.de>
Thu, 4 Jun 2026 08:20:41 +0000 (10:20 +0200)
commit83615ff7c61ce2336b81b68cfbba6eadaf7843e9
tree0c5e1c353c1db42b50d8e4302bf8be4c289d495a
parent3580bc53520ce4efc94ece5886ad3670b93667ba
ALSA: control: Use scoped cleanup for user control buffers

User-defined control TLV data and enum names are copied from user space
with vmemdup_user() before being installed in the user_element. Until
ownership is transferred, these temporary buffers have to be released on
every validation exit.

Use __free(kvfree) for the temporary buffers and no_free_ptr() when
ownership is transferred to the user_element. This removes the manual
kvfree() calls from the unchanged-TLV and enum-name validation paths,
makes the ownership hand-off explicit, and keeps the existing allocation
accounting and ABI unchanged.

No functional change is intended.

Signed-off-by: Cássio Gabriel <cassiogabrielcontato@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20260604-alsa-scoped-cleanups-v1-1-10c43152a728@gmail.com
sound/core/control.c