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

Commit 5855f684 authored by Bhalchandra Gajare's avatar Bhalchandra Gajare Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: core: Fix possible NULL pointer de-reference



Fix the soc_find_component function to make sure either the of_node or
the name is provided to compare against the registered components to fix
possible NULL pointer de-reference.

CRs-fixed: 925138
Change-Id: Ic1f02c341c06cadcfe6de638ff6c86e51845e59f
Signed-off-by: default avatarBhalchandra Gajare <gajare@codeaurora.org>
Signed-off-by: default avatarMeng Wang <mwang@codeaurora.org>
parent 3de89dd0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -981,6 +981,12 @@ static struct snd_soc_component *soc_find_component(
{
	struct snd_soc_component *component;

	if (!of_node && !name) {
		pr_err("%s: Either of_node or name must be valid\n",
			__func__);
		return NULL;
	}

	lockdep_assert_held(&client_mutex);

	list_for_each_entry(component, &component_list, list) {