Re: [PATCH 2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai

2019-07-16 Thread Krzysztof Kozlowski
On Sat, 13 Jul 2019 at 05:48, Wen Yang wrote: > > The cpu_dai variable is still being used after the of_node_put() call, > which may result in double-free: > > of_node_put(cpu_dai);---> released here > > ret = devm_snd_soc_register_card(dev, card); > if (ret < 0

Re: [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai

2019-07-14 Thread Markus Elfring
> These two updates fix two different bugs. I can follow this view to some degree. > and the other is the double-free issue This programming error affects also the use of data structures which became invalid. https://cwe.mitre.org/data/definitions/415.html#oc_415_Notes > So we sent two patch

Re: [2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai

2019-07-14 Thread Markus Elfring
> The cpu_dai variable is still being used after the of_node_put() call, Such an implementation detail is questionable. https://wiki.sei.cmu.edu/confluence/display/c/MEM30-C.+Do+not+access+freed+memory > which may result in double-free: This consequence is also undesirable. https://cwe.mitre.or

[PATCH 2/2] ASoC: samsung: odroid: fix a double-free issue for cpu_dai

2019-07-12 Thread Wen Yang
The cpu_dai variable is still being used after the of_node_put() call, which may result in double-free: of_node_put(cpu_dai);---> released here ret = devm_snd_soc_register_card(dev, card); if (ret < 0) { ... goto err_put_clk_i2s;--> jump to