Linux Sound subsystem development
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: broonie@kernel.org, lgirdwood@gmail.com, tiwai@suse.com,
	vkoul@kernel.org, srini@kernel.org,
	yung-chuan.liao@linux.intel.com, pierre-louis.bossart@linux.dev,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	neil.armstrong@linaro.org, krzysztof.kozlowski@linaro.org,
	linux-sound@vger.kernel.org, Stable@vger.kernel.org
Subject: Re: [PATCH v3 01/12] ASoC: codecs: wcd937x: set the comp soundwire port correctly
Date: Fri, 5 Sep 2025 17:47:42 +0100	[thread overview]
Message-ID: <08afe342-e108-4f0c-9903-fb4df4eb860e@oss.qualcomm.com> (raw)
In-Reply-To: <as3wxoths3rgy2qpbqwyys6zydhjo3lbueu7ibrwbinxt3sffw@wyprroihsjs7>

On 9/5/25 5:14 PM, Dmitry Baryshkov wrote:
> On Fri, Sep 05, 2025 at 04:44:19PM +0100, Srinivas Kandagatla wrote:
>> For some reason we endup with setting soundwire port for
>> HPHL_COMP and HPHR_COMP as zero, this can potentially result
>> in a memory corruption due to accessing and setting -1 th element of
>> port_map array.
> 
> Nit: if passing 0 here might result in a memory corrution, then
> corresponding code should be fixed to warn loudly and ignore that 0.

Agreed, This is something that should be fixed at source am on it.

--srini

> 
>>
>> Fixes: 82be8c62a38c ("ASoC: codecs: wcd937x: add basic controls")
>> Cc: <Stable@vger.kernel.org>
>> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
>> ---
>>  sound/soc/codecs/wcd937x.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/codecs/wcd937x.c b/sound/soc/codecs/wcd937x.c
>> index 3b0a8cc314e0..de2dff3c56d3 100644
>> --- a/sound/soc/codecs/wcd937x.c
>> +++ b/sound/soc/codecs/wcd937x.c
>> @@ -2046,9 +2046,9 @@ static const struct snd_kcontrol_new wcd937x_snd_controls[] = {
>>  	SOC_ENUM_EXT("RX HPH Mode", rx_hph_mode_mux_enum,
>>  		     wcd937x_rx_hph_mode_get, wcd937x_rx_hph_mode_put),
>>  
>> -	SOC_SINGLE_EXT("HPHL_COMP Switch", SND_SOC_NOPM, 0, 1, 0,
>> +	SOC_SINGLE_EXT("HPHL_COMP Switch", WCD937X_COMP_L, 0, 1, 0,
>>  		       wcd937x_get_compander, wcd937x_set_compander),
>> -	SOC_SINGLE_EXT("HPHR_COMP Switch", SND_SOC_NOPM, 1, 1, 0,
>> +	SOC_SINGLE_EXT("HPHR_COMP Switch", WCD937X_COMP_R, 1, 1, 0,
>>  		       wcd937x_get_compander, wcd937x_set_compander),
>>  
>>  	SOC_SINGLE_TLV("HPHL Volume", WCD937X_HPH_L_EN, 0, 20, 1, line_gain),
>> -- 
>> 2.50.0
>>
> 


  reply	other threads:[~2025-09-05 16:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-05 15:44 [PATCH v3 00/12] ASoC: codecs: wcd93xxx: remove code duplication Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 01/12] ASoC: codecs: wcd937x: set the comp soundwire port correctly Srinivas Kandagatla
2025-09-05 16:14   ` Dmitry Baryshkov
2025-09-05 16:47     ` Srinivas Kandagatla [this message]
2025-09-05 15:44 ` [PATCH v3 02/12] soundwire: bus: add of_sdw_find_device_by_node helper Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 03/12] soundwire: bus: add sdw_slave_get_current_bank helper Srinivas Kandagatla
2025-09-05 16:42   ` Dmitry Baryshkov
2025-09-05 15:44 ` [PATCH v3 04/12] ASoC: codecs: wcdxxxx: use of_sdw_find_device_by_node helper Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 05/12] ASoC: codecs: wcdxxxx: use sdw_slave_get_current_bank helper Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 06/12] ASoC: codecs: wcd: add common helper for wcd codecs Srinivas Kandagatla
2025-09-05 16:42   ` Dmitry Baryshkov
2025-09-06 20:23   ` kernel test robot
2025-09-07  9:44     ` Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 07/12] ASoC: codecs: wcd-common: move WCD_SDW_CH to common Srinivas Kandagatla
2025-09-06 21:15   ` kernel test robot
2025-09-05 15:44 ` [PATCH v3 08/12] ASoC: codecs: wcd-common: move component ops " Srinivas Kandagatla
2025-09-05 15:44 ` [PATCH v3 09/12] ASoC: codecs: wcd939x: get regmap directly Srinivas Kandagatla
2025-09-05 16:43   ` Dmitry Baryshkov
2025-09-05 15:44 ` [PATCH v3 10/12] ASoC: codecs: wcd-common: move status_update callback to common Srinivas Kandagatla
2025-09-05 16:44   ` Dmitry Baryshkov
2025-09-05 15:44 ` [PATCH v3 11/12] ASoC: codecs: wcd938x: get regmap directly Srinivas Kandagatla
2025-09-05 16:45   ` Dmitry Baryshkov
2025-09-05 15:44 ` [PATCH v3 12/12] ASoC: codecs: wcd937x: " Srinivas Kandagatla
2025-09-05 16:45   ` Dmitry Baryshkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08afe342-e108-4f0c-9903-fb4df4eb860e@oss.qualcomm.com \
    --to=srinivas.kandagatla@oss.qualcomm.com \
    --cc=Stable@vger.kernel.org \
    --cc=broonie@kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=pierre-louis.bossart@linux.dev \
    --cc=srini@kernel.org \
    --cc=tiwai@suse.com \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox