Instead of using goto, when there is no controls, just do a loop when
there are. Overall the check seems to be a bit redundant as
num_kcontrols will only be above 0 if kcontrols are set anyway, but
let's keep it, while simplifying code.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://patch.msgid.link/20240627101850.2191513-2-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
if (dobj->unload)
dobj->unload(comp, dobj);
- if (!w->kcontrols)
- goto free_news;
-
- for (i = 0; w->kcontrols && i < w->num_kcontrols; i++)
- snd_ctl_remove(card, w->kcontrols[i]);
-
-free_news:
+ if (w->kcontrols)
+ for (i = 0; i < w->num_kcontrols; i++)
+ snd_ctl_remove(card, w->kcontrols[i]);
list_del(&dobj->list);