Skip to content

Commit 639467c

Browse files
linuswbroonie
authored andcommitted
ASoC: dapm: fix some pointer error handling
commit 66feeec9322132689d42723df2537d60f96f8e44 "RFC: ASoC: dapm: handle probe deferrals" forgot a to update some two sites where the call was used. The static codechecks quickly found them. Reported-by: Dan Carpenter <[email protected]> Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals") Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 37e1df8 commit 639467c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

sound/soc/soc-dapm.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3935,6 +3935,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
39353935
template.name);
39363936

39373937
w = snd_soc_dapm_new_control_unlocked(dapm, &template);
3938+
if (IS_ERR(w)) {
3939+
int ret = PTR_ERR(w);
3940+
3941+
/* Do not nag about probe deferrals */
3942+
if (ret != -EPROBE_DEFER)
3943+
dev_err(dapm->dev,
3944+
"ASoC: Failed to create %s widget (%d)\n",
3945+
dai->driver->playback.stream_name, ret);
3946+
return ret;
3947+
}
39383948
if (!w) {
39393949
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
39403950
dai->driver->playback.stream_name);
@@ -3954,6 +3964,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
39543964
template.name);
39553965

39563966
w = snd_soc_dapm_new_control_unlocked(dapm, &template);
3967+
if (IS_ERR(w)) {
3968+
int ret = PTR_ERR(w);
3969+
3970+
/* Do not nag about probe deferrals */
3971+
if (ret != -EPROBE_DEFER)
3972+
dev_err(dapm->dev,
3973+
"ASoC: Failed to create %s widget (%d)\n",
3974+
dai->driver->playback.stream_name, ret);
3975+
return ret;
3976+
}
39573977
if (!w) {
39583978
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
39593979
dai->driver->capture.stream_name);

0 commit comments

Comments
 (0)