snd_ctl_t *ctl;
int result, err;
+ /* no-op, remove the plugin */
+ if (!remap && !map)
+ goto _noop;
+
priv = calloc(1, sizeof(*priv));
if (priv == NULL)
return -ENOMEM;
/* no-op check, remove the plugin */
if (priv->map_items == 0 && priv->remap_items == 0) {
remap_free(priv);
+ _noop:
free(child->name);
child->name = name ? strdup(name) : NULL;
if (name && !child->name)
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
if (err < 0)
return err;
- /* no-op, remove the plugin */
- if (!remap && !map) {
- *handlep = cctl;
- return 0;
- }
err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode);
if (err < 0)
snd_ctl_close(cctl);