From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: patches.audio@intel.com, alsa-devel@alsa-project.org,
broonie@kernel.org,
"Subhransu S. Prusty" <subhransu.s.prusty@intel.com>,
lgirdwood@gmail.com
Subject: Re: [PATCH] ASoC: topology: Fix not to keep a reference to tplg fw
Date: Thu, 26 Nov 2015 14:40:16 +0530 [thread overview]
Message-ID: <20151126091016.GK25173@localhost> (raw)
In-Reply-To: <s5hoaeh6t8w.wl-tiwai@suse.de>
On Thu, Nov 26, 2015 at 09:48:47AM +0100, Takashi Iwai wrote:
> On Thu, 26 Nov 2015 15:11:00 +0100,
> Subhransu S. Prusty wrote:
> >
> > During element creation, the name of some of the elements point
> > to memory referenced in tplg fw. If the tplg fw is released after
> > tplg is parsed by framework, kernel panic happens during creation
> > of elements while card initialization.
>
> In which code path? When the kctl is already instantiated from
> snd_kcontrol_new template, we don't have to duplicate the string.
> The only case where the strdup() is required is to delay the
> instantiation, i.e. storing the kcontrol_new object itself instead of
> referring temporarily.
So in SKL, we do request firmware of topology binary and topology core uses
that for strings here, so the patch 87b5ed8ec freed the topology binary
which causes panic while accessing kcontrols.
Your second point is applicable here as card instantiation is delayed often
for us as all components may not be present and delayed probe finally
creates the card.
> > Issue is caught with id#87b5ed8ecb9fe05a696e1c0b53c7a49ea66432c1
>
> You should put the commit subject, too.
Yes we will add that
> > So create a copy of the memory and assign to names instead.
>
> And who releases these duplicated memory? It looks like another
> memory leak to me.
That is a good point and I think we should do devm_kstrdup() here so that
this is freed when we cleanup the device, or do you have any better
suggestion ?
--
~Vinod
next prev parent reply other threads:[~2015-11-26 9:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-26 14:11 [PATCH] ASoC: topology: Fix not to keep a reference to tplg fw Subhransu S. Prusty
2015-11-26 8:48 ` Takashi Iwai
2015-11-26 9:10 ` Vinod Koul [this message]
2015-11-26 9:19 ` Takashi Iwai
2015-11-26 11:01 ` Mark Brown
2015-11-26 11:03 ` Takashi Iwai
2015-11-26 11:19 ` Vinod Koul
2015-11-26 11:24 ` Vinod Koul
2015-11-26 11:46 ` Takashi Iwai
2015-11-26 16:13 ` Vinod Koul
2015-11-26 17:39 ` Takashi Iwai
2015-11-27 9:15 ` Subhransu S. Prusty
2015-11-27 5:54 ` Takashi Iwai
2015-11-27 11:42 ` Subhransu S. Prusty
2015-11-27 6:21 ` Takashi Iwai
2015-11-26 11:02 ` Mark Brown
2015-11-26 11:11 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151126091016.GK25173@localhost \
--to=vinod.koul@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=patches.audio@intel.com \
--cc=subhransu.s.prusty@intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.