]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: fix the wrong return value in uc_mgr_open_ctl()
authorJaroslav Kysela <perex@perex.cz>
Mon, 8 Jun 2020 07:57:27 +0000 (09:57 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 8 Jun 2020 07:57:35 +0000 (09:57 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/utils.c

index ae101d45c3f3bcc6b365a7333c723a8c94872eb9..fbced51a25431630888c9933fc5222d04058c279 100644 (file)
@@ -274,7 +274,7 @@ int uc_mgr_open_ctl(snd_use_case_mgr_t *uc_mgr,
        if (err < 0 || id == NULL || id[0] == '\0') {
                uc_error("control hardware info (%s): %s", device, snd_strerror(err));
                snd_ctl_close(ctl);
-               return err;
+               return err >= 0 ? -EINVAL : err;
        }
 
        /* insert to cache, if just name differs */