]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: return always at least NULL if no list is available in snd_use_case_get_list()
authorJaroslav Kysela <perex@perex.cz>
Fri, 29 Nov 2019 21:28:26 +0000 (22:28 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 29 Nov 2019 21:32:21 +0000 (22:32 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/main.c

index 252e50d9a38701eee030c0da84e4398e374d4f66..b80db65fa93bd8239dd8bd2b7431b76e668faf48 100644 (file)
@@ -1160,8 +1160,10 @@ static int get_supcon_device_list(snd_use_case_mgr_t *uc_mgr,
 
        modifier = find_modifier(uc_mgr, verb, name, 0);
        if (modifier) {
-               if (modifier->dev_list.type != type)
+               if (modifier->dev_list.type != type) {
+                       *list = NULL;
                        return 0;
+               }
                return get_list(&modifier->dev_list.list, list,
                                struct dev_list_node, list,
                                name);
@@ -1169,8 +1171,10 @@ static int get_supcon_device_list(snd_use_case_mgr_t *uc_mgr,
 
        device = find_device(uc_mgr, verb, name, 0);
        if (device) {
-               if (device->dev_list.type != type)
+               if (device->dev_list.type != type) {
+                       *list = NULL;
                        return 0;
+               }
                return get_list(&device->dev_list.list, list,
                                struct dev_list_node, list,
                                name);