Skip to content

Commit ed0dd92

Browse files
jhovoldbroonie
authored andcommitted
ASoC: codecs: wcd938x: fix missing clsh ctrl error handling
Allocation of the clash control structure may fail so add the missing error handling to avoid dereferencing an error pointer. Fixes: 8d78602 ("ASoC: codecs: wcd938x: add basic driver") Cc: stable@vger.kernel.org # 5.14 Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230705123018.30903-4-johan+linaro@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 46ec420 commit ed0dd92

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

sound/soc/codecs/wcd938x.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,6 +3106,10 @@ static int wcd938x_soc_codec_probe(struct snd_soc_component *component)
31063106
WCD938X_ID_MASK);
31073107

31083108
wcd938x->clsh_info = wcd_clsh_ctrl_alloc(component, WCD938X);
3109+
if (IS_ERR(wcd938x->clsh_info)) {
3110+
pm_runtime_put(dev);
3111+
return PTR_ERR(wcd938x->clsh_info);
3112+
}
31093113

31103114
wcd938x_io_init(wcd938x);
31113115
/* Set all interrupts as edge triggered */

0 commit comments

Comments
 (0)