From patchwork Fri Jun 28 09:58:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 808514 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 B139BC2BBCA for ; Fri, 28 Jun 2024 09:59:20 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 956CE2353; Fri, 28 Jun 2024 11:59:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 956CE2353 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1719568758; bh=ucYPMV442p30SxLxZMrLgQRWfuQy7jPceEvUT16eTtw=; h=From:To:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=IVEhLmRrNRh8QrWglK/COTL+3zdvoSGWUmarbXxYtNSKiAz2Y3mG2jyTggMumLLK5 wArxil70NnkrCBySU8L2vYqhN2viU1glyXJJ+P2jhWDbxTo78wagnoHJqDP32wkB+H 9VGT4ZKopCW3WedW3fovowzodFegENxOEEyrkTvg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3D2FDF805B0; Fri, 28 Jun 2024 11:58:47 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E6C03F805A9; Fri, 28 Jun 2024 11:58:46 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 77062F80495; Fri, 28 Jun 2024 11:58:41 +0200 (CEST) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8239DF800E4 for ; Fri, 28 Jun 2024 11:58:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8239DF800E4 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=gk2JcjOf Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-366e70d0330so327010f8f.1 for ; Fri, 28 Jun 2024 02:58:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719568715; x=1720173515; darn=alsa-project.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=qnCrcRP7t2cWM1AO0t9JWEwOXAFYL4HbHcO1KAiAVOo=; b=gk2JcjOfl8WnNcyszK3jPOqYarwV8kQ0kXbSH+mJ54e0T16ueYoVf8UldLpWU9kRB7 KwyHl2w8OWpnR+Xi0ih82zvIm1q512swgPv43+/OIvBfBCN3MO3UiIKhmRDJ/qHesFIJ gwWBqRUwKSge1fatb5C6HxlCX3RG9nTBfwn2xJB532w+TaIWlPwuW1RFKEKK60miqVJn AUD/oK4y1Uujl/e+kMUpVcULZHRv8UAC6L8vx3zTzMxNI3LrjdFBvEnN6YeeSiH5c6KW 4iza5OMoMoxBhHEXvXD60rMGFuTStDYer+AUmk+//+NngyflRQneuJpaFzeAqga6Agmz MQUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719568715; x=1720173515; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qnCrcRP7t2cWM1AO0t9JWEwOXAFYL4HbHcO1KAiAVOo=; b=AyNr2sLrXXt8NKRJtWbamKAKI9zBhCOzsk0yss46Yyi0q4ta0NjFicg4IiJ3RUHktv fFRF1BDNLnDqdIco8aHUP7UNGv/KgU3E7PHb80BB6N7cVhGk7EOxJu7EjXbhzG1HKrqy yox0ztaYVduaqvIn86r4Aipzrd+eY7NyMrpVcNh2IrpAl7y1efBbmfRHXtSOVRRaQK9Q 5KPOb1kIjp+3NJVd5N7HLA5AiCOys087qTrEHQSiarB+ieZ7/ec2s6IE0XZa83lJTbta 0jvhHewHsiOQD3NVOadDcfoNPV8l7J6F6YWPCDbvJdpF1fN6eRFA/6EQnA/3/cAojRKm wchA== X-Forwarded-Encrypted: i=1; AJvYcCXxncXEGpcF0A0m7LdFn+URTTB10i5rrVN6S5FrghloTgti2hGNwmmbSGTtavAFNj66uKG+dqv4GQjG6Xq2VVEBXsmOFdjlbiArQuc= X-Gm-Message-State: AOJu0YyFJdoAXlSDqOw2OLlRkepu3/31ukQv+asrACMKLOVvxCO1BZc4 X2xMy40QpOUc/iWnHlRkS4ewuCsvYLRXKk4udPRbDSaGkmvNgfl0zZ2cAKwpugQ= X-Google-Smtp-Source: AGHT+IGj5zErCya6zo4TRvSCsMgDrJeZu+46l03p6bj9wmdPmAbzwhqn1j9jubXkm8l8eNFE6EkAUA== X-Received: by 2002:a05:6000:156a:b0:367:434f:ca9a with SMTP id ffacd0b85a97d-367434fcca3mr3973868f8f.0.1719568714852; Fri, 28 Jun 2024 02:58:34 -0700 (PDT) Received: from krzk-bin.. ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0e13d4sm1760802f8f.56.2024.06.28.02.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 02:58:34 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Dmitry Baryshkov , Krzysztof Kozlowski , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] ASoC: codecs: lpass-rx-macro: Fix using NULL pointer in probe() dev_err Date: Fri, 28 Jun 2024 11:58:30 +0200 Message-ID: <20240628095831.207942-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: ONK6YXF5OATUQJTL2WORJOALEA7BOUHF X-Message-ID-Hash: ONK6YXF5OATUQJTL2WORJOALEA7BOUHF X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The 'rx->dev' is assigned closer to the end of the probe() function, so the dev_err() must not use it - it is still NULL at this point. Instead there is already a local 'dev' variable. Fixes: dbacef05898d ("ASoC: codec: lpass-rx-macro: prepare driver to accomdate new codec versions") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/lpass-rx-macro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/lpass-rx-macro.c b/sound/soc/codecs/lpass-rx-macro.c index 08308a63d1b7..8d4a61f7debc 100644 --- a/sound/soc/codecs/lpass-rx-macro.c +++ b/sound/soc/codecs/lpass-rx-macro.c @@ -3843,7 +3843,7 @@ static int rx_macro_probe(struct platform_device *pdev) rx_2_5_defaults, sizeof(rx_2_5_defaults)); break; default: - dev_err(rx->dev, "Unsupported Codec version (%d)\n", rx->codec_version); + dev_err(dev, "Unsupported Codec version (%d)\n", rx->codec_version); ret = -EINVAL; goto err; } From patchwork Fri Jun 28 09:58:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 808288 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 16C3CC2BBCA for ; Fri, 28 Jun 2024 10:00:29 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2F21B2353; Fri, 28 Jun 2024 12:00:17 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2F21B2353 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1719568827; bh=pXcJZXfOduG19g33CWHG/iY96S5LfDhVExDtf7vtU/c=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=l46gA7iKAmdLPG88zU1AoFxFOBLfOdl8t5a/f7K+HbFic60Lx/yi9e/W5lqrDidb9 qdT+AXOGIIDFS63yElw011nmcGknM5nHIvD+UoqeBmfPjEp0srkLbk63VKCaK9WvU+ d3Fc+PiymPMToErUbSqToeE9xAMM5XsMUJ3obV8A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2788AF8016E; Fri, 28 Jun 2024 11:59:56 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id D3CD6F8058C; Fri, 28 Jun 2024 11:59:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CC642F80423; Fri, 28 Jun 2024 11:58:42 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 7671DF80154 for ; Fri, 28 Jun 2024 11:58:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 7671DF80154 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=J9JFcv3u Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-424acfff613so4679045e9.0 for ; Fri, 28 Jun 2024 02:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1719568716; x=1720173516; darn=alsa-project.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Vj7f8gpSZwh6TRqOjZfbXgm8n7bo9ud79bHIhbKk/yE=; b=J9JFcv3uyrtoVs7/9UWIQpw22HFWmJmTMN1p+icHWYYxvvW9Wc2eqIrrdZ6/6zW23u qJ5tZWg0DwFBKaooaiAg2f58fO5SqNhXG8Bh2RVFq5swrful6mofUe5bn1QgvLSC0IwR wLiKmGGN+72M0uWLZzfFAoIDUFDErxPvC3KvfOKip9xy6ShqeO/Dqu9QAs+kNGMYpod3 C7849iz0HD4hFXqG7u/IznqmSp1ZAhdDMS+NzoLFQObmw/kPcv4rKCgIgA4cdW7nKgEQ xWtA/YKzyi/VPxhy8vk5pepvxbY6T5dpPrsfJ+PPU5C/N/HuHttAv9CPx0De8ri6ud9c W+Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719568716; x=1720173516; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Vj7f8gpSZwh6TRqOjZfbXgm8n7bo9ud79bHIhbKk/yE=; b=fwxgVlxqr6yeI4Fe9e15B91MEI3p0UjB9NzZ47Q+CLE8tE7RfPKYl8Aez/WsMUVSfW BmF10gGopYjwY0jlZFb1j+OQ9wNayFKPB6Nz12CaAD1CycDMK8P/HDch/x73RjhSFy3n OlJtpMqC+Kh2z+SIwi8/Pk/tMiBjodeHmw52CiqIQH4ya0aVFMt0gipGI8hFrYaYlETZ akFIE76HoQe2lF458+4fDxrt12SWYVt0hkrOUur8wJul9d2kTmhbJ9L3Pu3Ox9Yu0SDd VkfiPqH3nr+c784OTwhRLNeQuqiSuNOIhZo6oR3DxfW0YzhTGE7PlGrR2zFWb21LbOW0 aGRA== X-Forwarded-Encrypted: i=1; AJvYcCVBkUZzeJm42KbGo+s/b6XqPW/dSUsPzejbPUDFHtYAo1dnutAWYoC+t/yRhRfUQkqw6VgVLaEsjQTJZ2S5++5t76Qsv1l0UiZI3FE= X-Gm-Message-State: AOJu0YwjBCj3O1LD1XI9AGAGAF5Vp+vsTQswJ17Cv8395TGDJKs36HrO zmmaiZyz5WvKS0tTxcaL7nowHOpBnq8kqUlr5MZT2eWdKK0MxXfMnIs0P66Grhg= X-Google-Smtp-Source: AGHT+IGOECgt/Tx2J3NULa0P6WR60IFU9SZLYVOKALAhoMlIlXENOp0BXYMSZmaQsxPOdOKobn4xsw== X-Received: by 2002:a05:600c:1e1e:b0:425:6a52:eaa5 with SMTP id 5b1f17b1804b1-4256a52ec38mr15858465e9.41.1719568716326; Fri, 28 Jun 2024 02:58:36 -0700 (PDT) Received: from krzk-bin.. ([178.197.219.137]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0e13d4sm1760802f8f.56.2024.06.28.02.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jun 2024 02:58:35 -0700 (PDT) From: Krzysztof Kozlowski To: Srinivas Kandagatla , Banajit Goswami , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Dmitry Baryshkov , Krzysztof Kozlowski , alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] ASoC: codecs: lpass-wsa-macro: Fix using NULL pointer in probe() dev_err Date: Fri, 28 Jun 2024 11:58:31 +0200 Message-ID: <20240628095831.207942-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240628095831.207942-1-krzysztof.kozlowski@linaro.org> References: <20240628095831.207942-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Message-ID-Hash: ZDZT5O2VYDMSF4X5CYSE7SAIPFK2KPRV X-Message-ID-Hash: ZDZT5O2VYDMSF4X5CYSE7SAIPFK2KPRV X-MailFrom: krzysztof.kozlowski@linaro.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The 'wsa->dev' is assigned closer to the end of the probe() function, so the dev_err() must not use it - it is still NULL at this point. Instead there is already a local 'dev' variable. Fixes: 727de4fbc546 ("ASoC: codecs: lpass-wsa-macro: Correct support for newer v2.5 version") Signed-off-by: Krzysztof Kozlowski Reviewed-by: Dmitry Baryshkov --- sound/soc/codecs/lpass-wsa-macro.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/codecs/lpass-wsa-macro.c b/sound/soc/codecs/lpass-wsa-macro.c index f619b06b8aec..14e0cc4fbff3 100644 --- a/sound/soc/codecs/lpass-wsa-macro.c +++ b/sound/soc/codecs/lpass-wsa-macro.c @@ -2798,7 +2798,7 @@ static int wsa_macro_probe(struct platform_device *pdev) break; default: - dev_err(wsa->dev, "Unsupported Codec version (%d)\n", wsa->codec_version); + dev_err(dev, "Unsupported Codec version (%d)\n", wsa->codec_version); return -EINVAL; }