From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796315085; b=cWtpaF/N0eELi0tav98iKH5cA2dPHbq4BQPqwRj8q2MFrRg+keLiG4EcVNYvXeTh8TB6 d1tlyjfjRfjW16VHmFkk7yJQ9BhGi0UJOGZ5bfD5Kj/nHSRMZ3np79YNEvfcCQxkikjas PKzMwvnkzrzv9iHxzaLC+tRVKaVu8BZcn46hbxTgqN0mgIXulptOX4UQhOb7eW16TivDd dD2AgWBmvlF+vdRvmRF7WLGRRzev5cDaNDKDXVeqaKjvqOuPY65j9UGhHJQ3VIqSOOYkU kBXou5o5F1kLxhvgRN/5Ht3H9NuGfRgvgMmlCPiDeZD81Ex1tNTQ4kas7EV8o/YnWWw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796315085; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=18hAiCDXJVakRe4rxOt8xEpd0ymU5mXg1OkoOM02GS4=; b=TR8/zDKe37uknvAMlk4qa0NA7WDsTjftpepovMPGSVMimcszho9EtWFqufrHeHNaGheG 8sfxD0a0PccX8sTLAB9rYPHu2dS7sqld356Lf9I/yKM6WF8uBb6AqQsf40IqbWjHk4GeM StgxXkPpSZ1jdmBIBhMHp6eJYjbuPxZQ/DxnlvOB/QcrHxb8XA9dZRLA4AQ9UUgFORE8p ZfAatOcqnUd5vmku5XJrLFI3ehvLNAAejGPuNG5N23pSjQKwKS+rPAEUp5/7vGTVDfwgm yzxs2o7/reVUpM9KuT9HSUeO04eI8LcsufcDtpoeajO/9l57Qfgw5zatj3/6DSysjUg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RCvmfXYI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54AF5606A322 for ; Thu, 3 Dec 2026 16:24:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=RCvmfXYI Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DBF81F00893; Thu, 3 Dec 2026 16:24:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796315085; bh=18hAiCDXJVakRe4rxOt8xEpd0ymU5mXg1OkoOM02GS4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=RCvmfXYIsWNLj4ILXoXLSAKZ/aUeNy664EGtzqaAOWj615HAOjln9ohWhYZs7IE0/ +m8Yt//urZ/U4DSAxvliXPcs7uMw7X5g3QMV77s5ssf/1GeVuB2QhMuNiB261auufX xvIJEaCZcw150eIH+9RyQIcbMHOaxIQ0W1LpL9vE7jCDyXBdPd84LdD+RnPcwOQvQh Fy3f+oSxVRnsRwclq1NfUzgenf2xpn7yRS/5PdMxrQoywn6R2ueTsphVhbe0V6/ZEG glIjXTtQCKKBIgf+BtmJeD3ZOOqaUxcss6qB4z7Uf5abyUXKne8Cheji69ouay1sxc +VflEGFvGZKaw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v3 6/8] ALSA: hda/cs35l41: Store filenames of successfully loaded firmware and tunings Reply-To: sashiko-reviews@lists.linux.dev To: "Stefan Binding" Cc: linux-sound@vger.kernel.org In-Reply-To: <20261203141359.150688-7-sbinding@opensource.cirrus.com> References: <20261203141359.150688-1-sbinding@opensource.cirrus.com> <20261203141359.150688-7-sbinding@opensource.cirrus.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 16:24:44 +0000 X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] ALSA: hda/cs35l41: leak of cached filenames on component_add() failure - [Low] ALSA: hda/cs35l41: skip_tuning_params latched on transient firmware errors -- commit 513d2c01c40a2002d0419b32112d33551ebde10f Author: Stefan Binding ALSA: hda/cs35l41: Store filenames of successfully loaded firmware and tuni= ngs This commit caches the successfully loaded firmware and coefficient filenames in struct cs35l41_hda so subsequent reloads reuse them directly instead of searching candidate filenames again. It also records when tuning parameter files fail to load to skip requesting them later. > diff --git a/sound/hda/codecs/side-codecs/cs35l41_hda.c b/sound/hda/codec= s/side-codecs/cs35l41_hda.c > index 2c6efd07df801..51ac11270c88f 100644 > --- a/sound/hda/codecs/side-codecs/cs35l41_hda.c > +++ b/sound/hda/codecs/side-codecs/cs35l41_hda.c > @@ -142,6 +142,7 @@ static int cs35l41_request_tuning_param_file(struct c= s35l41_hda *cs35l41, char * > dev_dbg(cs35l41->dev, "Failed to request '%s'\n", *filename); > kfree(*filename); > *filename =3D NULL; > + cs35l41->skip_tuning_params =3D true; > } > =20 > return ret; [Severity: Low] Can a transient firmware_request_nowarn() error (such as -ENOMEM or -EIO) permanently latch cs35l41->skip_tuning_params? Any non-zero return sets skip_tuning_params and nothing clears it, even if the file already loaded on boot and failed temporarily on resume. Since cs35l41_init_dsp() resets tuning_gain to DEFAULT_AMP_GAIN_PCM on each reload, the tuned gain stays lost until driver removal. Only latching skip_tuning_params on initial load when the file is missing would avoid this. [ ... ] > @@ -600,6 +623,10 @@ static void cs35l41_remove_dsp(struct cs35l41_hda *c= s35l41) > cs35l41_shutdown_dsp(cs35l41); > cs_dsp_remove(dsp); > cs35l41->halo_initialized =3D false; > + kfree(cs35l41->wmfw_filename); > + kfree(cs35l41->coeff_filename); > + cs35l41->wmfw_filename =3D NULL; > + cs35l41->coeff_filename =3D NULL; > } [Severity: Medium] Can cs35l41->wmfw_filename and cs35l41->coeff_filename leak if component_add() fails in cs35l41_hda_probe()? component_add() can synchronously invoke cs35l41_hda_bind() -> cs35l41_smart_amp() -> cs35l41_init_dsp() to allocate both strings. If cs35l41_create_controls() then fails, cs35l41_hda_probe() unwinds without calling cs35l41_remove_dsp(), and cs35l41_hda_remove() never runs. Freeing both strings in the probe error path would avoid the leak. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203141359.1506= 88-1-sbinding@opensource.cirrus.com?part=3D6