* [bug report] ASoC: rsnd: call missing snd_ctl_remove()
@ 2016-12-15 9:44 Dan Carpenter
2016-12-15 23:40 ` Kuninori Morimoto
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2016-12-15 9:44 UTC (permalink / raw)
To: kuninori.morimoto.gx; +Cc: alsa-devel
Hello Kuninori Morimoto,
The patch d1f83d6ef43b: "ASoC: rsnd: call missing snd_ctl_remove()"
from Feb 2, 2015, leads to the following static checker warning:
sound/soc/sh/rcar/core.c:1034 __rsnd_kctrl_new()
error: double free of 'kctrl'
sound/soc/sh/rcar/core.c
1026 int ret;
1027
1028 kctrl = snd_ctl_new1(&knew, mod);
1029 if (!kctrl)
1030 return -ENOMEM;
1031
1032 ret = snd_ctl_add(card, kctrl);
1033 if (ret < 0) {
1034 snd_ctl_free_one(kctrl);
The snd_ctl_add() function frees kctrl on error. It's a confusing
layering violation IMHO but there are a lot of callers so I'm too lazy
to clean this up myself...
1035 return ret;
1036 }
1037
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] ASoC: rsnd: call missing snd_ctl_remove()
2016-12-15 9:44 [bug report] ASoC: rsnd: call missing snd_ctl_remove() Dan Carpenter
@ 2016-12-15 23:40 ` Kuninori Morimoto
0 siblings, 0 replies; 2+ messages in thread
From: Kuninori Morimoto @ 2016-12-15 23:40 UTC (permalink / raw)
To: Dan Carpenter; +Cc: alsa-devel
Hi Dan
Thank you for reporting about this.
I think this issue was solved by this patch which is in mark/fix/rcar
0ea617a298dcdc2251b4e10f83ac3f3e627b66e3
("ASoC: rsnd: don't double free kctrl")
> The patch d1f83d6ef43b: "ASoC: rsnd: call missing snd_ctl_remove()"
> from Feb 2, 2015, leads to the following static checker warning:
>
> sound/soc/sh/rcar/core.c:1034 __rsnd_kctrl_new()
> error: double free of 'kctrl'
>
> sound/soc/sh/rcar/core.c
> 1026 int ret;
> 1027
> 1028 kctrl = snd_ctl_new1(&knew, mod);
> 1029 if (!kctrl)
> 1030 return -ENOMEM;
> 1031
> 1032 ret = snd_ctl_add(card, kctrl);
> 1033 if (ret < 0) {
> 1034 snd_ctl_free_one(kctrl);
>
> The snd_ctl_add() function frees kctrl on error. It's a confusing
> layering violation IMHO but there are a lot of callers so I'm too lazy
> to clean this up myself...
>
> 1035 return ret;
> 1036 }
> 1037
>
> regards,
> dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-12-15 23:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-15 9:44 [bug report] ASoC: rsnd: call missing snd_ctl_remove() Dan Carpenter
2016-12-15 23:40 ` Kuninori Morimoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).