[<prev] [next>] [day] [month] [year] [list]
Message-ID: <cf3c5ed3-69bb-4ff0-8377-29cb6fe7a358@gmail.com>
Date: Tue, 8 Oct 2024 18:18:50 +0100
From: "Colin King (gmail)" <colin.i.king@...il.com>
To: Jack Yu <jack.yu@...ltek.com>, Mark Brown <broonie@...nel.org>
Cc: linux-sound@...r.kernel.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: re: ASoC: rt721-sdca: Add RT721 SDCA driver
Hi Jack,
There is an unsigned variable check in commit:
commit 86ce355c1f9ab943bbe099ea7d0b8a3af2247f65
Author: Jack Yu <jack.yu@...ltek.com>
Date: Tue Oct 1 09:17:38 2024 +0000
ASoC: rt721-sdca: Add RT721 SDCA driver
function rt721_sdca_jack_detect_handler, the following code does not
initialize variable ret:
int btn_type = 0, ret;
if (!rt721->hs_jack)
return;
if (!rt721->component->card ||
!rt721->component->card->instantiated)
return;
/* SDW_SCP_SDCA_INT_SDCA_6 is used for jack detection */
if (rt721->scp_sdca_stat1 & SDW_SCP_SDCA_INT_SDCA_6) {
rt721->jack_type = rt_sdca_headset_detect(rt721->regmap,
RT721_SDCA_ENT_GE49);
if (ret < 0)
return;
}
..and there is a check for ret < 0, even though it's not been assigned.
Should that be a check on rtl->jack_type < 0 instead?
Colin
Powered by blists - more mailing lists