Message ID | 20230112234426.1714071-1-cujomalainey@chromium.org (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | ucm: add existence checks to geti calls | expand |
diff --git a/src/ucm/main.c b/src/ucm/main.c index 2ff4d3f3..39edf3ae 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -1321,6 +1321,9 @@ long device_status(snd_use_case_mgr_t *uc_mgr, if (strcmp(dev->name, device_name) == 0) return 1; } + dev = find_device(uc_mgr, uc_mgr->active_verb, device_name, 0); + if (!dev) + return -ENOENT; return 0; } @@ -1335,6 +1338,9 @@ long modifier_status(snd_use_case_mgr_t *uc_mgr, if (strcmp(mod->name, modifier_name) == 0) return 1; } + mod = find_modifier(uc_mgr, uc_mgr->active_verb, device_name, 0); + if (!mod) + return -ENOENT; return 0; }