Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1786565pxf; Fri, 26 Mar 2021 15:01:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwge63xRW8mgi/vljW5lff2WKhzUROkWHhNe0tbCoTpK4ns74OSBKm/uJKJIRc1ik0nQoBR X-Received: by 2002:a17:906:cd12:: with SMTP id oz18mr17662028ejb.498.1616796115652; Fri, 26 Mar 2021 15:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616796115; cv=none; d=google.com; s=arc-20160816; b=oSTOJTQtHxv76UMKT2knC+kROAmJwwfmPhHkvmDp8i4L5m8akb5EP1gKWLWBxlWC3j /dk8N4xx5BIO+iBgmzK1kll7+YHmvz1o4Lkn6nSIwiBjCqNj+++KxFDHVzIVgaAm5O0B gUhqJysqV2yn38G7o032N5gyIO7M29ml8IJF5oMZ83pcxdYapH77jef2qCo5Xn2QMNsY 6qM6MhWPNQQSYilKXxIVjqGu/X2OBca/ynLtJvUmwRchbEiUjbh5uCo/wMShtGHFEVm/ TmyCsozX5P6KQE3mM9ePw06yIpLU4XlsYugtmzVmJE23rq1ItD02C4dvKhE4d0TeDfVR MxAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=YOrYy/wYru+xjtyWEJxvYiGzq85kqNndmDxZ9Z40UxM=; b=AgNFQkoih7Te0ez6efbAzEXOsLLYL655AlAv4zMgGPuwLb5NDvCTo1o0dVruTMczoH uZpoSlkaug25PYD8P46dwrUeeDl4Wf0bLgtS8aBKLvtkH6Oc2FVF+KQlQRE+3FFwvbuR 8oCo3DCwgW5OEI8SMsjc3mZa8KUynmZA2+KwciqHiZGmip7PEn7T1nJZBLwscQLktSa4 V6Sk9OS7XtGlIs6k7/KIU9wPqJE55YBaRuUT1mZBx78ZO196kLiu3Loz9P0N7Tc/2p2l Zx2w7rqleHf9llHK3WEbhZjNj+1mhtKU+EA2lftGDj0XQpCNmkN5Y7yK3SeA8HG7KFqC 0qKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn20si8651960ejc.347.2021.03.26.15.01.33; Fri, 26 Mar 2021 15:01:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230459AbhCZWAi (ORCPT + 99 others); Fri, 26 Mar 2021 18:00:38 -0400 Received: from mga04.intel.com ([192.55.52.120]:61331 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230240AbhCZWAG (ORCPT ); Fri, 26 Mar 2021 18:00:06 -0400 IronPort-SDR: QYRJqNk+1Th4UN+qa3tJ5I1YDm7E0W7jMCRtIEBJahI3+OpEqcaJLu85uK7592BzUS/lzf+qGm ZpHI0AQzchjg== X-IronPort-AV: E=McAfee;i="6000,8403,9935"; a="188957088" X-IronPort-AV: E=Sophos;i="5.81,281,1610438400"; d="scan'208";a="188957088" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2021 15:00:06 -0700 IronPort-SDR: 7NWZHaaay1C/1PxCKzjdVdf7YwM5gdF5YFKIj46EH6by9m9zByzidJ4/VP14TKr0nh48yjZQF1 4NwB0i7DUqAQ== X-IronPort-AV: E=Sophos;i="5.81,281,1610438400"; d="scan'208";a="416706795" Received: from zcmahone-mobl1.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.255.231.203]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2021 15:00:05 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Cc: tiwai@suse.de, broonie@kernel.org, linux-kernel@vger.kernel.org, Pierre-Louis Bossart , Arnaud Pouliquen , Liam Girdwood , Jaroslav Kysela , Takashi Iwai Subject: [PATCH 08/17] ASoC: sti: sti_uniperif: add missing error check Date: Fri, 26 Mar 2021 16:59:18 -0500 Message-Id: <20210326215927.936377-9-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210326215927.936377-1-pierre-louis.bossart@linux.intel.com> References: <20210326215927.936377-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org cppcheck warning: sound/soc/sti/sti_uniperif.c:490:6: style: Variable 'ret' is reassigned a value before the old one has been used. [redundantAssignment] ret = devm_snd_soc_register_component(&pdev->dev, ^ sound/soc/sti/sti_uniperif.c:486:6: note: ret is assigned ret = sti_uniperiph_cpu_dai_of(node, priv); ^ sound/soc/sti/sti_uniperif.c:490:6: note: ret is overwritten ret = devm_snd_soc_register_component(&pdev->dev, ^ sti_uniperiph_cpu_dai_of() can return -EINVAL which seems like a good-enough reason to bail. Signed-off-by: Pierre-Louis Bossart --- sound/soc/sti/sti_uniperif.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/sti/sti_uniperif.c b/sound/soc/sti/sti_uniperif.c index 7b9169f04d6e..67315d9b352d 100644 --- a/sound/soc/sti/sti_uniperif.c +++ b/sound/soc/sti/sti_uniperif.c @@ -484,6 +484,8 @@ static int sti_uniperiph_probe(struct platform_device *pdev) priv->pdev = pdev; ret = sti_uniperiph_cpu_dai_of(node, priv); + if (ret < 0) + return ret; dev_set_drvdata(&pdev->dev, priv); -- 2.25.1