]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ALSA: oss: Relax __free() variable declarations
authorTakashi Iwai <tiwai@suse.de>
Tue, 16 Dec 2025 14:06:26 +0000 (15:06 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 17 Dec 2025 09:08:30 +0000 (10:08 +0100)
commit55f98ece9939a0ad5f83c6124dd1f00d678f9f46
tree330a508469d3b9a5f741b9510ed217e493723096
parentf3d233daf011abbad2f6ebd0e545b42d2f378a4f
ALSA: oss: Relax __free() variable declarations

We used to have a variable declaration with __free() initialized with
NULL.  This was to keep the old coding style rule, but recently it's
relaxed and rather recommends to follow the new rule to declare in
place of use for __free() -- which avoids potential deadlocks or UAFs
with nested cleanups.

Although the current code has no bug, per se, let's follow the new
standard and move the declaration to the place of assignment (or
directly assign the allocated result) instead of NULL initializations.

Fixes: a55bc334d3df ("ALSA: pcm_oss: ump: Use automatic cleanup of kfree()")
Fixes: 6c40eec521af ("ALSA: mixer_oss: ump: Use automatic cleanup of kfree()")
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://patch.msgid.link/20251216140634.171890-5-tiwai@suse.de
sound/core/oss/mixer_oss.c
sound/core/oss/pcm_oss.c