diff options
| author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2026-10-19 17:45:30 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2026-10-20 10:46:46 +0200 |
| commit | fbc74ca9fbf7e0b8f6872ccac62f9f4a1f3b5e53 (patch) | |
| tree | 1e760f13939a26b35acc698d61ed6226349a1e9a /scripts/Makefile.thinlto | |
| parent | c739a2a548c84b515bb6a04ade8dfe7d1919961e (diff) | |
| download | linux-fbc74ca9fbf7e0b8f6872ccac62f9f4a1f3b5e53.tar.gz linux-fbc74ca9fbf7e0b8f6872ccac62f9f4a1f3b5e53.zip | |
ALSA: compress: fix buffer leak on failed SET_PARAMS
When the driver has neither ops->copy nor a preallocated dma_buffer_p,
snd_compr_allocate_buffer() kmallocs runtime->buffer. If
ops->set_params() then rejects the parameters, SET_PARAMS fails, the
stream stays in the OPEN state and keeps the buffer. The next
SET_PARAMS allocates a new buffer and overwrites the pointer, so
repeated SET_PARAMS calls with parameters that the driver rejects leak
one buffer per call.
Release the framework-owned buffer when ops->set_params() fails on an
OPEN stream, so that a failed SET_PARAMS leaves no buffer behind and
the buffer is allocated only once per successful setup. Use the same
ownership check as snd_compr_free().
Fixes: b21c60a4edd2 ("ALSA: core: add support for compress_offload")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://patch.msgid.link/20261019144533.30665-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
