18 Dec
2019
18 Dec
'19
2:26 p.m.
On Fri, Dec 13, 2019 at 02:05:32AM +0800, Tzung-Bi Shih wrote:
I have no enough resources to test and trace the code temporarily. But is it possible:
- snd_card_new( ) succeed in snd_soc_bind_card( ), so that userspace
can see the control
This feels like snd_card_new() is being overly enthusiastic here, I'd expect that we might have other problems elsewhere with that. I'd not expect userspace to see things until snd_card_register() since between _new() and that we're in the process of building the card up. Given this we *will* need to handle partially constructed cards after all, unless we change the ALSA core. Takashi?
- code in later snd_soc_bind_card( ) decided to defer the probe
- soc_cleanup_card_resources( ) may forget to clean the control? (not
sure about this)
There's going to be a race condition where userspace can see the control on the partially built card regardless of if it gets cleaned up or not.