Skip to content

Commit 368e466

Browse files
tititiou36tiwai
authored andcommitted
ALSA: mixer_oss: Remove some incorrect kfree_const() usages
"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: 454f5ec ("ALSA: mixer: oss: Constify snd_mixer_oss_assign_table definition") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://patch.msgid.link/63ac20f64234b7c9ea87a7fa9baf41e8255852f7.1727374631.git.christophe.jaillet@wanadoo.fr Signed-off-by: Takashi Iwai <[email protected]>
1 parent dee4769 commit 368e466

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/core/oss/mixer_oss.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,8 @@ static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)
901901
struct slot *p = chn->private_data;
902902
if (p) {
903903
if (p->allocated && p->assigned) {
904-
kfree_const(p->assigned->name);
905-
kfree_const(p->assigned);
904+
kfree(p->assigned->name);
905+
kfree(p->assigned);
906906
}
907907
kfree(p);
908908
}

0 commit comments

Comments
 (0)