Re: [PATCH v1 3/3] ASoC: soc-core: fix platform name vs. of_node assignement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jon

> Actually no. Looking at snd_soc_init_multicodec() it always allocates
> memory if any of the 'legacy' codec members
> (codec_name/codec_of_node/codec_dai_name) are populated. However, this
> looks quite fragile to me and is susceptible to leaking memory if the
> user/machine driver already incorrectly allocated the memory as well as
> populating these legacy codec members.

Yeah, sorry I was 100% misunderstood.
I thought there is a case that defered card connected to
unbind_card_list, and try snd_soc_init_platform/codec again
without freeing memory...
very mess

> My concern about all of this is it is not fool proof and hard to detect
> if a machine driver is doing something bad that it should not.

Yeah, agree.
Best solution is removing legacy style, I think.

> It is still fragile. Again the machine driver could have incorrectly set
> these 'allocated_platform/codecs' members as they are exposed to the
> machine driver. You have no way to determine if the machine driver is
> doing the correct thing or not. The problem becomes more complex with
> probe deferral.

Indeed there is such case so far, but my understanding is that current
driver should select "legacy style" or "modern style".
If driver setup it as "legacy", but access to "modern" member,
it is driver side bug, right ?

Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux