Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2392f7fd authored by Vinod Koul's avatar Vinod Koul Committed by Mark Brown
Browse files

ASoC: Intel: Skylake: Check list empty while getting module info



Module list can be NULL so check if the list is empty before
accessing the list.

Signed-off-by: default avatarSenthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e7ca8fcd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;