OSDN Git Service

ALSA: oss: Release temporary buffers upon errors
authorTakashi Iwai <tiwai@suse.de>
Fri, 18 Mar 2022 08:21:57 +0000 (09:21 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 18 Mar 2022 13:01:28 +0000 (14:01 +0100)
commit8a580a26760cb14535c160613fe9cd0e4dc6f5c6
treedd6585959eaf89354bc9f12b72c4bd2a45dd43e2
parenta893b7fc7b59cdf3fae01335c86537bee4407edc
ALSA: oss: Release temporary buffers upon errors

When the parameter changes fails, we don't need to keep the old
temporary buffers.  Release those (and plugin instances) upon errors
for reducing dead memory footprint.  Since we always call it at the
exit of snd_pcm_oss_changes_params_locked(), the explicit calls of
snd_pcm_oss_plugin_clear() can be dropped, too.

Along with it, unify the buffer-free calls to a single helper and call
it from the needed places.

Link: https://lore.kernel.org/r/20220318082157.29769-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/oss/pcm_oss.c