From patchwork Fri Jan 20 13:07:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9528275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C316060459 for ; Fri, 20 Jan 2017 13:21:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B425D2851F for ; Fri, 20 Jan 2017 13:21:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5819285B9; Fri, 20 Jan 2017 13:21:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E4762851F for ; Fri, 20 Jan 2017 13:21:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E9BF0266C8A; Fri, 20 Jan 2017 14:21:01 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1AC37266725; Fri, 20 Jan 2017 14:18:43 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6B148266EC7; Fri, 20 Jan 2017 14:08:03 +0100 (CET) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by alsa0.perex.cz (Postfix) with ESMTP id D244E265A82 for ; Fri, 20 Jan 2017 14:08:01 +0100 (CET) Received: by mail-lf0-f48.google.com with SMTP id z134so57854970lff.3 for ; Fri, 20 Jan 2017 05:08:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=OBlrg4vhYgvuQbtu+cJIo58TXQ7ThXwx1UIUEpGLAIE=; b=VGi1/0mYsbceDIogb0+dvBtCv3pptMHR0MR1k/OA/T8MNTj4P6POARqVGFJwXsPMB8 JuhDYCE4oWVsKeBGsqwTQ62P/WakL8zCm8l+SN2yBWUE9UWmcmTamtXVhigs4L2rm1Oe 6mkwd6fMbB4R7merOzOUYe0fmhpiNNWLe8fYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=OBlrg4vhYgvuQbtu+cJIo58TXQ7ThXwx1UIUEpGLAIE=; b=UKKtVi1f2V07bRHBOF8ZNgcfsRug5zJb0pgbLisqmruxRsJjdrRSflMkbDLX/b6rDS dZqCdqmwBwjfEbHra3/EHrRVVPUOE8k4kiDkjeLkAqmw/NJoYT8rmLZXpMnHyWOyvuE3 Q++CEntw6KVW3JnQucK4Xss48Gsth2CmmbFdNfzgEmw2A39rPWdttZyfD+bp08BDprwC 7qux3se/VDAVGeosUJqlos9eUXthf6l2if+z9doruFGS9sPwYB+5YzDDczlWUmWTx8rE 5t4fKlFKKkxFjxM5Qqxqz/jJsFj5RzVmpeGtIWhAnYCFrzdTf9O6Rhu4SG2WtYBDIzQC 2iLw== X-Gm-Message-State: AIkVDXK85WKLT2rWQXKKoAA6AUdI1YIrRYZx+g+59CFkwuJCUJAUySN6lZpMIKRqd1+0CdPC X-Received: by 10.46.69.139 with SMTP id s133mr6801058lja.56.1484917680809; Fri, 20 Jan 2017 05:08:00 -0800 (PST) Received: from gnarp.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id x78sm3437183lfb.44.2017.01.20.05.07.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jan 2017 05:08:00 -0800 (PST) From: Linus Walleij To: Liam Girdwood , Mark Brown Date: Fri, 20 Jan 2017 14:07:52 +0100 Message-Id: <20170120130752.29107-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.3 Cc: alsa-devel@alsa-project.org, Lars-Peter Clausen , Linus Walleij , Dan Carpenter Subject: [alsa-devel] [PATCH] ASoC: dapm: fix some pointer error handling X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Cc: Lars-Peter Clausen Cc: Dan Carpenter Reported-by: Dan Carpenter Fixes: 66feeec93221 ("RFC: ASoC: dapm: handle probe deferrals") Signed-off-by: Linus Walleij --- sound/soc/soc-dapm.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index b218cc7bd994..dcef67a9bd48 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3935,6 +3935,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->playback.stream_name); @@ -3954,6 +3964,16 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, template.name); w = snd_soc_dapm_new_control_unlocked(dapm, &template); + if (IS_ERR(w)) { + int ret = PTR_ERR(w); + + /* Do not nag about probe deferrals */ + if (ret != -EPROBE_DEFER) + dev_err(dapm->dev, + "ASoC: Failed to create %s widget (%d)\n", + dai->driver->playback.stream_name, ret); + return ret; + } if (!w) { dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dai->driver->capture.stream_name);