diff options
| author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2024-09-26 20:17:36 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-10 11:57:19 +0200 |
| commit | 466129e3d0ad2f0703fa714ccdb7f07343f7c66d (patch) | |
| tree | 92cf4809ad2d47b619cf641b73087ea47150821d /sound/core | |
| parent | 0152c81f61fa9d163882420ce3b22d08f07b8345 (diff) | |
| download | linux-466129e3d0ad2f0703fa714ccdb7f07343f7c66d.tar.gz linux-466129e3d0ad2f0703fa714ccdb7f07343f7c66d.tar.bz2 linux-466129e3d0ad2f0703fa714ccdb7f07343f7c66d.zip | |
ALSA: mixer_oss: Remove some incorrect kfree_const() usages
[ Upstream commit 368e4663c557de4a33f321b44e7eeec0a21b2e4e ]
"assigned" and "assigned->name" are allocated in snd_mixer_oss_proc_write()
using kmalloc() and kstrdup(), so there is no point in using kfree_const()
to free these resources.
Switch to the more standard kfree() to free these resources.
This could avoid a memory leak.
Fixes: 454f5ec1d2b7 ("ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://patch.msgid.link/63ac20f64234b7c9ea87a7fa9baf41e8255852f7.1727374631.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/core')
| -rw-r--r-- | sound/core/oss/mixer_oss.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c index dae2da380835..abc99ae33328 100644 --- a/sound/core/oss/mixer_oss.c +++ b/sound/core/oss/mixer_oss.c @@ -967,8 +967,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn) struct slot *p = chn->private_data; if (p) { if (p->allocated && p->assigned) { - kfree_const(p->assigned->name); - kfree_const(p->assigned); + kfree(p->assigned->name); + kfree(p->assigned); } kfree(p); } |
