From patchwork Wed Feb 16 02:11:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Li X-Patchwork-Id: 12747846 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4476AC433F5 for ; Wed, 16 Feb 2022 02:12:21 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8E10D1717; Wed, 16 Feb 2022 03:11:29 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8E10D1717 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1644977539; bh=3mW+K2DoVM3p73yamKYhLBRUF5y2Wz/jULL9EmpcsUY=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Oa2hZ9WPSwqLvkM4xNpqMpOXNOVFmQDOvAkd8JkI1Uz8TlOGXagK4SU/v+Yxwxw+0 V0uxXkWTNgiLfSat7p66GAAKSHzIUWd1jfvrWD1bomIqKTT1CyCxgkJ2zcvUdPaavV usslWGAbsWeJ2r90Su2MLYoEuL8woXWZ7yud+6Gc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 27112F800C0; Wed, 16 Feb 2022 03:11:29 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6EF48F80132; Wed, 16 Feb 2022 03:11:28 +0100 (CET) Received: from out199-11.us.a.mail.aliyun.com (out199-11.us.a.mail.aliyun.com [47.90.199.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 2CFEBF800C0 for ; Wed, 16 Feb 2022 03:11:24 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 2CFEBF800C0 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=e01e01424; MF=yang.lee@linux.alibaba.com; NM=1; PH=DS; RN=9; SR=0; TI=SMTPD_---0V4b3tCJ_1644977477; Received: from localhost(mailfrom:yang.lee@linux.alibaba.com fp:SMTPD_---0V4b3tCJ_1644977477) by smtp.aliyun-inc.com(127.0.0.1); Wed, 16 Feb 2022 10:11:18 +0800 From: Yang Li To: perex@perex.cz Subject: [PATCH -next] ASoC: codec: wcd938x: Fix NULL but dereferenced coccicheck error Date: Wed, 16 Feb 2022 10:11:16 +0800 Message-Id: <20220216021116.94384-1-yang.lee@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, lgirdwood@gmail.com, Abaci Robot , linux-kernel@vger.kernel.org, tiwai@suse.com, broonie@kernel.org, Yang Li , quic_srivasam@quicinc.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Eliminate the following coccicheck warning: ./sound/soc/codecs/wcd938x.c:4210:21-24: ERROR: component is NULL but dereferenced. Reported-by: Abaci Robot Fixes: 013cc2aea0f6 ("ASoC: codec: wcd938x: Add switch control for selecting CTIA/OMTP Headset") Signed-off-by: Yang Li --- sound/soc/codecs/wcd938x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c index 2663fe0bf64f..c46c4bfd84f2 100644 --- a/sound/soc/codecs/wcd938x.c +++ b/sound/soc/codecs/wcd938x.c @@ -4207,7 +4207,7 @@ static bool wcd938x_swap_gnd_mic(struct snd_soc_component *component, bool activ struct wcd938x_priv *wcd938x; if (!component) { - dev_err(component->dev, "%s component is NULL\n", __func__); + pr_err("The snd_soc_component is NULL\n"); return false; }