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

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

Merge "ASoC: wcd934x: Initialize mbhc pointer before access"

parents d8ad28c0 1fcf0af7
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -1015,6 +1015,7 @@ int tavil_mbhc_init(struct wcd934x_mbhc **mbhc, struct snd_soc_codec *codec,
				0;
				0;
	}
	}


	(*mbhc) = wcd934x_mbhc;
	snd_soc_add_codec_controls(codec, impedance_detect_controls,
	snd_soc_add_codec_controls(codec, impedance_detect_controls,
				   ARRAY_SIZE(impedance_detect_controls));
				   ARRAY_SIZE(impedance_detect_controls));
	snd_soc_add_codec_controls(codec, hph_type_detect_controls,
	snd_soc_add_codec_controls(codec, hph_type_detect_controls,
@@ -1023,8 +1024,6 @@ int tavil_mbhc_init(struct wcd934x_mbhc **mbhc, struct snd_soc_codec *codec,
	snd_soc_update_bits(codec, WCD934X_MBHC_NEW_CTL_1, 0x04, 0x04);
	snd_soc_update_bits(codec, WCD934X_MBHC_NEW_CTL_1, 0x04, 0x04);
	snd_soc_update_bits(codec, WCD934X_MBHC_CTL_BCS, 0x01, 0x01);
	snd_soc_update_bits(codec, WCD934X_MBHC_CTL_BCS, 0x01, 0x01);


	(*mbhc) = wcd934x_mbhc;

	return 0;
	return 0;
err:
err:
	devm_kfree(codec->dev, wcd934x_mbhc);
	devm_kfree(codec->dev, wcd934x_mbhc);