Skip to content

Commit c571039

Browse files
Linus Walleijgregkh
authored andcommitted
ASoC: dapm: fix some pointer error handling
[ Upstream commit 639467c8f26d834c934215e8b59129ce442475fe ] 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 <dan.carpenter@oracle.com> Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals") Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7b8c9e6 commit c571039

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

sound/soc/soc-dapm.c

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

37963796
w = snd_soc_dapm_new_control_unlocked(dapm, &template);
3797+
if (IS_ERR(w)) {
3798+
int ret = PTR_ERR(w);
3799+
3800+
/* Do not nag about probe deferrals */
3801+
if (ret != -EPROBE_DEFER)
3802+
dev_err(dapm->dev,
3803+
"ASoC: Failed to create %s widget (%d)\n",
3804+
dai->driver->playback.stream_name, ret);
3805+
return ret;
3806+
}
37973807
if (!w) {
37983808
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
37993809
dai->driver->playback.stream_name);
@@ -3813,6 +3823,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
38133823
template.name);
38143824

38153825
w = snd_soc_dapm_new_control_unlocked(dapm, &template);
3826+
if (IS_ERR(w)) {
3827+
int ret = PTR_ERR(w);
3828+
3829+
/* Do not nag about probe deferrals */
3830+
if (ret != -EPROBE_DEFER)
3831+
dev_err(dapm->dev,
3832+
"ASoC: Failed to create %s widget (%d)\n",
3833+
dai->driver->playback.stream_name, ret);
3834+
return ret;
3835+
}
38163836
if (!w) {
38173837
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
38183838
dai->driver->capture.stream_name);

0 commit comments

Comments
 (0)