[PATCH 0/3] ALSA: scoped cleanup improvements for ALSA core

From: Cássio Gabriel

Date: Thu Jun 04 2026 - 00:48:38 EST


This series converts a few local ALSA ownership patterns
to scoped cleanup helpers.

- The first patch uses __free(kvfree) for temporary user control buffers
in the ALSA control core.
- The second patch promotes the existing local snd_card_unref cleanup
helper to the common ALSA core header and uses it for temporary card
references in the control layer.
- The third patch applies the same idea to the temporary OSS sequencer
MIDI use-lock reference added for embedded SysEx event lifetime handling.

These are cleanup/hardening changes only. No functional change is intended.

Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
---
Cássio Gabriel (3):
ALSA: control: Use scoped cleanup for user control buffers
ALSA: core: Add scoped cleanup helper for card references
ALSA: seq: oss: Use scoped cleanup for temporary MIDI use lock

include/sound/core.h | 2 ++
sound/core/control.c | 36 +++++++++++++++++-------------------
sound/core/control_led.c | 11 ++++-------
sound/core/seq/oss/seq_oss_event.h | 1 +
sound/core/seq/oss/seq_oss_ioctl.c | 10 ++++------
sound/core/seq/oss/seq_oss_rw.c | 5 ++---
6 files changed, 30 insertions(+), 35 deletions(-)
---
base-commit: 10a5707d968cf679d3ceb849eae5317b45c80c60
change-id: 20260601-alsa-scoped-cleanups-2b22958dab12

Best regards,
--
Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>