Skip to content

Commit

Permalink
ASoC: Intel: Skylake: Check list empty while getting module info
Browse files Browse the repository at this point in the history
Module list can be NULL so check if the list is empty before
accessing the list.

Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Vinod Koul authored and Mark Brown committed Aug 1, 2016
1 parent e7ca8fc commit 2392f7f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/soc/intel/skylake/skl-sst-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ int snd_skl_get_module_info(struct skl_sst *ctx, u8 *uuid,

uuid_mod = (uuid_le *)uuid;

if (list_empty(&ctx->uuid_list)) {
dev_err(ctx->dev, "Module list is empty\n");
return -EINVAL;
}

list_for_each_entry(module, &ctx->uuid_list, list) {
if (uuid_le_cmp(*uuid_mod, module->uuid) == 0) {
dfw_config->module_id = module->id;
Expand Down

0 comments on commit 2392f7f

Please sign in to comment.