From mboxrd@z Thu Jan 1 00:00:00 1970 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 0FFFBF588C2 for ; Mon, 20 Apr 2026 13:18:55 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [45.14.194.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 27A7D601F3; Mon, 20 Apr 2026 15:18:43 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 27A7D601F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1776691133; bh=G3vgPIuJyGHx+pbP3p2kYDmPMMfVxfTRLcgSZFSeSI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XX+uuvhuwfSRmL8Vv1lDbr++KCkb7vTbeWl6dAkyp78simEptj3lcngeL4zQizKcM ZcEmo4hJjOwXk+Fd1jEBS4WZMLZcDOzek3FKYkMSAIR8Fyx73e+GY7Y91sgFfbioMJ 6xsGMBwq2EQvwU8WhpWS6u54SoChhfS5YjW3JioI= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5D999F806E8; Mon, 20 Apr 2026 15:16:52 +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 E369CF806E5; Mon, 20 Apr 2026 15:16:51 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 40E22F80679; Mon, 20 Apr 2026 15:16:37 +0200 (CEST) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 3D10DF805E1 for ; Mon, 20 Apr 2026 15:16:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 3D10DF805E1 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=qXW0tIyd Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id B747540E89; Mon, 20 Apr 2026 13:16:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C0EEC2BCC4; Mon, 20 Apr 2026 13:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776690992; bh=G3vgPIuJyGHx+pbP3p2kYDmPMMfVxfTRLcgSZFSeSI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qXW0tIydUgfh1ruzH5eVppKeYoI++XCokx+j8azGHd3ZFeVMz6upiivvNyFlicus/ IikFbQdSuFAqWrlb8NkMw3CHQxYlZEmeke1mEKcB4WNhe970nwOUJfLK24YkoFA4j1 Mjw8Jldvs1Arm2UxW8WOeLo3cya3ax2QVEtqn0tdb739ut/IPGKB6f32AjYOgu3Xi3 FesnJ71JKXv2LFwlHspiBqmBZv/K5zojHZJBtVBjnImBCZmHvi7avRnA7VkF+JB6Cs ud6JUnmmI0oH90oRRRuA+vFkbgeNlNAD/oyvgPd6uwEwe1zLgBn+T6GI3AJnbuh6hc v6ecs43FI9Geg== From: Sasha Levin To: patches@lists.linux.dev, stable@vger.kernel.org Cc: Cezary Rojewski , Mark Brown , Sasha Levin , pierre-louis.bossart@linux.intel.com, liam.r.girdwood@linux.intel.com, peter.ujfalusi@linux.intel.com, yung-chuan.liao@linux.intel.com, ranjani.sridharan@linux.intel.com, kai.vehmanen@linux.intel.com, perex@perex.cz, tiwai@suse.com, amadeuszx.slawinski@linux.intel.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH AUTOSEL 6.18] ASoC: Intel: avs: Fix memory leak in avs_register_i2s_test_boards() Date: Mon, 20 Apr 2026 09:08:17 -0400 Message-ID: <20260420131539.986432-31-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260420131539.986432-1-sashal@kernel.org> References: <20260420131539.986432-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.18.23 Content-Transfer-Encoding: 8bit Message-ID-Hash: STMPO4LGENFQ3RW3IHN35QQDCWLN4LUJ X-Message-ID-Hash: STMPO4LGENFQ3RW3IHN35QQDCWLN4LUJ X-MailFrom: sashal@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 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: From: Cezary Rojewski [ Upstream commit c5408d818316061d6063c11a4f47f1ba25a3a708 ] Caller is responsible for freeing array allocated with parse_int_array(). Found out by Coverity. Fixes: 7d859189de13 ("ASoC: Intel: avs: Allow to specify custom configurations with i2s_test") Signed-off-by: Cezary Rojewski Link: https://patch.msgid.link/20260407085459.400628-1-cezary.rojewski@intel.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- LLM Generated explanations, may be completely bogus: Error: Failed to generate final synthesis sound/soc/intel/avs/board_selection.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sound/soc/intel/avs/board_selection.c b/sound/soc/intel/avs/board_selection.c index 52e6266a7cb86..96dc637ccb20c 100644 --- a/sound/soc/intel/avs/board_selection.c +++ b/sound/soc/intel/avs/board_selection.c @@ -520,7 +520,8 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev) if (num_elems > max_ssps) { dev_err(adev->dev, "board supports only %d SSP, %d specified\n", max_ssps, num_elems); - return -EINVAL; + ret = -EINVAL; + goto exit; } for (ssp_port = 0; ssp_port < num_elems; ssp_port++) { @@ -528,11 +529,13 @@ static int avs_register_i2s_test_boards(struct avs_dev *adev) for_each_set_bit(tdm_slot, &tdm_slots, 16) { ret = avs_register_i2s_test_board(adev, ssp_port, tdm_slot); if (ret) - return ret; + goto exit; } } - return 0; +exit: + kfree(array); + return ret; } static int avs_register_i2s_board(struct avs_dev *adev, struct snd_soc_acpi_mach *mach) -- 2.53.0