ASoC: wcd934x: Initialize mbhc pointer before access
Initialize mbhc pointer before it gets accessed from a different thread. Change-Id: Ie1a5038458b0b93dfec3e5bfc350686eb1f8eb1b Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
This commit is contained in:
parent
30b895d9f1
commit
1fcf0af78a
1 changed files with 1 additions and 2 deletions
|
@ -1015,6 +1015,7 @@ int tavil_mbhc_init(struct wcd934x_mbhc **mbhc, struct snd_soc_codec *codec,
|
|||
0;
|
||||
}
|
||||
|
||||
(*mbhc) = wcd934x_mbhc;
|
||||
snd_soc_add_codec_controls(codec, impedance_detect_controls,
|
||||
ARRAY_SIZE(impedance_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_CTL_BCS, 0x01, 0x01);
|
||||
|
||||
(*mbhc) = wcd934x_mbhc;
|
||||
|
||||
return 0;
|
||||
err:
|
||||
devm_kfree(codec->dev, wcd934x_mbhc);
|
||||
|
|
Loading…
Add table
Reference in a new issue