Skip to content

Commit

Permalink
res: ucmd-module: check foreign_dev_id/foreign_dev_mod is not empty i…
Browse files Browse the repository at this point in the history
…n sid_ucmd_dev_alias_get_foreign_*
  • Loading branch information
prajnoha committed Jul 30, 2024
1 parent 97a1c7d commit 876c326
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/resource/ubridge.c
Original file line number Diff line number Diff line change
Expand Up @@ -3630,6 +3630,9 @@ const char **sid_ucmd_dev_alias_get_foreign_dev(sid_res_t *mod_res,
const char *alias_key,
size_t *count)
{
if (UTIL_STR_EMPTY(foreign_dev_id))
return NULL;

return _do_sid_ucmd_dev_alias_get(mod_res, ucmd_ctx, foreign_dev_id, NULL, alias_key, count);
}

Expand All @@ -3639,6 +3642,9 @@ const char **sid_ucmd_dev_alias_get_foreign_mod(sid_res_t *mod_res,
const char *alias_key,
size_t *count)
{
if (UTIL_STR_EMPTY(foreign_mod_name))
return NULL;

return _do_sid_ucmd_dev_alias_get(mod_res, ucmd_ctx, NULL, foreign_mod_name, alias_key, count);
}

Expand All @@ -3649,6 +3655,9 @@ const char **sid_ucmd_dev_alias_get_foreign_dev_mod(sid_res_t *mod_res
const char *alias_key,
size_t *count)
{
if (UTIL_STR_EMPTY(foreign_dev_id) || UTIL_STR_EMPTY(foreign_mod_name))
return NULL;

return _do_sid_ucmd_dev_alias_get(mod_res, ucmd_ctx, foreign_dev_id, foreign_mod_name, alias_key, count);
}

Expand Down

0 comments on commit 876c326

Please sign in to comment.