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

Commit ec9c501a authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ASoC: msm: fix the target crash due to the NULL pointer dereference"

parents 1c2f9f14 902985a4
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -5829,7 +5829,17 @@ static struct regulator *tapan_codec_find_regulator(
	const char *name)
{
	int i;
	struct wcd9xxx *core = dev_get_drvdata(codec->dev->parent);
	struct wcd9xxx *core = NULL;

	if (codec == NULL) {
		dev_err(codec->dev, "%s: codec not initialized\n", __func__);
		return NULL;
	}
	core = dev_get_drvdata(codec->dev->parent);
	if (core == NULL) {
		dev_err(codec->dev, "%s: core not initialized\n", __func__);
		return NULL;
	}

	for (i = 0; i < core->num_of_supplies; i++) {
		if (core->supplies[i].supply &&