lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6d0edbac-9b9c-4a90-a3c9-193198e8a088@intel.com>
Date: Thu, 4 Jan 2024 09:12:35 +0200
From: Adrian Hunter <adrian.hunter@...el.com>
To: Stefan Wahren <wahrenst@....net>,
 Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>,
 haibo.chen@....com, ulf.hansson@...aro.org, shawnguo@...nel.org,
 s.hauer@...gutronix.de
Cc: Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>, NXP Linux Team <linux-imx@....com>,
 linux-mmc@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mmc: sdhci-esdhc-imx: Fix smatch errors

On 29/12/23 16:34, Stefan Wahren wrote:
> Hi Hardevsinh,
> 
> the patch subject is a too generic. Maybe something like "fix
> initialization of target_min/max"
> 
> Am 29.12.23 um 14:02 schrieb Hardevsinh Palaniya:
>> Resolve smatch errors in esdhc_executing_tuning()
>>
>> esdhc_executing_tuning() error: uninitialized symbol 'target_min'
>> esdhc_executing_tuning() error: uninitialized symbol 'target_max'
> I think this deserve
> 
> Fixes: 541a95e64d76 ("mmc: sdhci-esdhc-imx: optimize the manual tuing
> logic to get the best timing")

Is smatch right though?

	while (max < ESDHC_TUNE_CTRL_MAX) {	// always true first iteration

	max = min + ESDHC_TUNE_CTRL_STEP;	// max > min

		max -= ESDHC_TUNE_CTRL_STEP;
		break;				// max >= min

	win_length = max - min + 1;		// always > 0 since max >= min

	if (win_length > target_win_length) {	// always true first iteration
		target_min = min;		// always initialized
		target_max = max;		// always initialized

> 
> Thanks
>> Signed-off-by: Hardevsinh Palaniya <hardevsinh.palaniya@...iconsignals.io>
>>
>> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
>> index 40a6e2f8145a..839b60138f04 100644
>> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
>> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
>> @@ -1166,6 +1166,8 @@ static int esdhc_executing_tuning(struct sdhci_host *host, u32 opcode)
>>       min = ESDHC_TUNE_CTRL_MIN;
>>       max = ESDHC_TUNE_CTRL_MIN;
>>       target_win_length = 0;
>> +    target_min = 0;
>> +    target_max = 0;
>>       while (max < ESDHC_TUNE_CTRL_MAX) {
>>           /* find the mininum delay first which can pass tuning */
>>           while (min < ESDHC_TUNE_CTRL_MAX) {
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ