On Thu, Mar 28, 2019 at 02:17:32PM +0100, Christian Gromm wrote: > +static int audio_create_sound_card(void) > +{ > + int ret; > + struct sound_adapter *adpt; > + > + list_for_each_entry(adpt, &adpt_list, list) { > + if (!adpt->registered) > + goto adpt_alloc; > + } > + return -ENODEV; > +adpt_alloc: > + ret = snd_card_register(adpt->card); > + if (ret < 0) { > + release_adapter(adpt); This doesn't feel right. We didn't acquire "adpt" in this function so why are we releasing it here. Do we release it somewhere else as well? It's still on the list... > + return ret; > + } > + adpt->registered = true; > + return ret; > +} regards, dan carpenter _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel