Received: by 2002:ab2:b82:0:b0:1f3:401:3cfb with SMTP id 2csp611392lqh; Thu, 28 Mar 2024 10:52:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUn0jU2rUGg1iiVEonEStwkln9AlsqbvhXbH5Tl1xQzEKUD0CJ7QjqfEZDMy6aC5bym7PLld8G6/fqDfzGFGLhs52fe3cfAT1/3Gvls/A== X-Google-Smtp-Source: AGHT+IEi67mlz9GOBjNJPrsWPuLWCMicanDHTjOWQuq5gvmStIn+r5Gr1fStLSoNMpYHK1aNvP9M X-Received: by 2002:a05:6e02:5a4:b0:368:9850:82c1 with SMTP id k4-20020a056e0205a400b00368985082c1mr3896283ils.13.1711648322406; Thu, 28 Mar 2024 10:52:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711648322; cv=pass; d=google.com; s=arc-20160816; b=iDl0t3Jo8RV1g2jY54bvVSTMw46sOtMeu1jHpkPOmh9Y7GxzGjgpdPcA6IigP3QTZD PQlJ7aof2z3jXaCFZFQ4vJzG9o5nsWXHHG27QTkdMkkBHiw3qi6dJI9uzgAyJQeyCqmC maLg6kD5lbufDAnGo1pzzo2mpj4y+kVuBaBTfpvzSaesExr3Ba9EJ3UJDDf+iPQbDRgr rEFslahFTgcB8rrHsWTzZGdJwPGDO1FqXpa5QxWEQ7qXNMke/IEz49W09UHVGh6x/F+W tg8hr88qABuEdVuF6HEO5yyzFd6USCIvgkRRIvgMM6VKi8JNlrD1bKyOJJhPzIvMrsvS oLLQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=woseDRdyM4juKO+cAWZ27r4/vCdyFNNlrp2AGifkU38=; fh=LeIl6DpId1dE8ZXHejidyUjregzBf6XS79K0oe9ZqYQ=; b=x6HgVN5p37gMR+eAWj+IjqNTQnfpTgr7hIh9QX7/TFnfDfGKtEc9f9juIKy6YdcffD M9DzVoZ4KtDwExrP+NCk6KEECTHkNfi2QR+TTGG6iJLf22Nc2qsquAunxVr0njHCUczi 0615aaLI91V2Mk17tzyhxfaZHn4uOkcNX64iYXNIbuN79BdAFFVj4DolL4rc4CxTn87j uzFbrKtKSuSkNCvXBbrR/rmAQQQQV4UqufUAOWucERdL9DsL0WPq4Ms/n4Xb7DBpBoAh 2NdQ0Qc//jN2ayuV/Xao+tpQtTXxRewK2tqVMTCCg5y5KJ+w2ZKUyMFNC+FHtky0hBzx j3Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@t-argos.ru header.s=mail header.b=fcRqWyBO; arc=pass (i=1 spf=pass spfdomain=t-argos.ru dkim=pass dkdomain=t-argos.ru dmarc=pass fromdomain=t-argos.ru); spf=pass (google.com: domain of linux-kernel+bounces-123370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=t-argos.ru Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id o6-20020a63fb06000000b005dcbb6b06bbsi1801870pgh.292.2024.03.28.10.52.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 10:52:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-123370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@t-argos.ru header.s=mail header.b=fcRqWyBO; arc=pass (i=1 spf=pass spfdomain=t-argos.ru dkim=pass dkdomain=t-argos.ru dmarc=pass fromdomain=t-argos.ru); spf=pass (google.com: domain of linux-kernel+bounces-123370-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-123370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=t-argos.ru Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 00DC2B25407 for ; Thu, 28 Mar 2024 17:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A73912F588; Thu, 28 Mar 2024 17:35:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=t-argos.ru header.i=@t-argos.ru header.b="fcRqWyBO" Received: from mx1.t-argos.ru (mx1.t-argos.ru [109.73.34.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F14B14A84; Thu, 28 Mar 2024 17:35:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.73.34.58 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711647320; cv=none; b=QW3N5dpVxWUVDNCK13WYkv1b6SA4/zDdPozRj1RYX3T6YheIR/XHPVjc87Y4cJem4X5KeppOYP2B2OsbXec/u6vc5aWS/mSFSymqG2qwbw8ez1IqQX+Gmj0uKITQG7QNccUTz6r5iL/kAZclF3zf39eRakgDAk1sIDuJMy1q1Gw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711647320; c=relaxed/simple; bh=pgpRjdYvE6XkBLzVGAuv411UInyEJ+Ima53o7NfjVLo=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=pZKCl5bcbC00VFAzgMHobbfsMTKtY0qPEMfZxxP5pS38DwPk7i8UG4B+5x72t1+ldY57s3xDRU1k0gTQ+wkGbFZ4meH9OnBqGzUbiVg7y9Wq6Pc3wkZhwNetLmhLDtpHbWmh+tQryrt3MUuqtVY3dI6vERDNa6zixUXYrzt2o10= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=t-argos.ru; spf=pass smtp.mailfrom=t-argos.ru; dkim=pass (2048-bit key) header.d=t-argos.ru header.i=@t-argos.ru header.b=fcRqWyBO; arc=none smtp.client-ip=109.73.34.58 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=t-argos.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=t-argos.ru Received: from mx1.t-argos.ru (localhost [127.0.0.1]) by mx1.t-argos.ru (Postfix) with ESMTP id DA28B100002; Thu, 28 Mar 2024 20:34:55 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=t-argos.ru; s=mail; t=1711647295; bh=woseDRdyM4juKO+cAWZ27r4/vCdyFNNlrp2AGifkU38=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=fcRqWyBOhVtuk2UBYQi9x6cOUr5ApkyJr8Jdk7j4b67G8m/6CAuISxAcuSzDkue25 PuNsjybe0pS/g1YoBt9vDLJJoyZFCxIGCYEvotx+wxccw3RXFZZfm4uC4TyMaEQCTP wnM35fHneXEkq9Imc2A1VvjuKp8WZYnRFGdymIImaq8yc6E+Xxv7AS3EXnTOcRgwS5 KBjyRRG9PJ1HCn7qUfqBL3SQ4EH64X2DfEvfvMIhzQbrG33O/OF8+oJjR6zYFsyjmO VOBGa/H2HYoPkLVUqOlf1zEeos4j+dNnZWBULNoGVYILr8Tgl4qk9tgEUahdZqGwsB Y5u2us+x8LYLQ== Received: from mx1.t-argos.ru.ru (ta-mail-02.ta.t-argos.ru [172.17.13.212]) by mx1.t-argos.ru (Postfix) with ESMTP; Thu, 28 Mar 2024 20:34:05 +0300 (MSK) Received: from localhost.localdomain (172.17.215.6) by ta-mail-02 (172.17.13.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Thu, 28 Mar 2024 20:33:44 +0300 From: Aleksandr Mishin To: Liam Girdwood CC: Aleksandr Mishin , Mark Brown , Jaroslav Kysela , Takashi Iwai , Kuninori Morimoto , , , Subject: [PATCH] ASoC: kirkwood: Fix potential NULL dereference Date: Thu, 28 Mar 2024 20:33:37 +0300 Message-ID: <20240328173337.21406-1-amishin@t-argos.ru> X-Mailer: git-send-email 2.30.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: ta-mail-02.ta.t-argos.ru (172.17.13.212) To ta-mail-02 (172.17.13.212) X-KSMG-Rule-ID: 1 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 184474 [Mar 28 2024] X-KSMG-AntiSpam-Version: 6.1.0.4 X-KSMG-AntiSpam-Envelope-From: amishin@t-argos.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 14 0.3.14 5a0c43d8a1c3c0e5b0916cc02a90d4b950c01f96, {Tracking_from_domain_doesnt_match_to}, d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;t-argos.ru:7.1.1;127.0.0.199:7.1.2;mx1.t-argos.ru.ru:7.1.1, FromAlignment: s X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean, bases: 2024/03/28 17:08:00 X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2024/03/28 12:50:00 #24493847 X-KSMG-AntiVirus-Status: Clean, skipped In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if CONFIG_PLAT_ORION macro is not defined. Fix this bug by adding NULL check. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: bb6a40fc5a83 ("ASoC: kirkwood: Fix reference to PCM buffer address") Signed-off-by: Aleksandr Mishin --- sound/soc/kirkwood/kirkwood-dma.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/soc/kirkwood/kirkwood-dma.c b/sound/soc/kirkwood/kirkwood-dma.c index dd2f806526c1..ef00792e1d49 100644 --- a/sound/soc/kirkwood/kirkwood-dma.c +++ b/sound/soc/kirkwood/kirkwood-dma.c @@ -182,6 +182,9 @@ static int kirkwood_dma_hw_params(struct snd_soc_component *component, const struct mbus_dram_target_info *dram = mv_mbus_dram_info(); unsigned long addr = substream->runtime->dma_addr; + if (!dram) + return 0; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) kirkwood_dma_conf_mbus_windows(priv->io, KIRKWOOD_PLAYBACK_WIN, addr, dram); -- 2.30.2