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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 9 Oct 2011 14:48:17 +0800
From:	wwang <wei_wang@...lsil.com.cn>
To:	Dan Carpenter <dan.carpenter@...cle.com>
CC:	"gregkh@...e.de" <gregkh@...e.de>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging:rts_pstor:Fix SDIO issue

Dear Carpenter:

Yes, the new code is exactly what I intended.
As to the following code, the old system responded fully wrong. It
should return STATUS_FAIL here instead.

3144 if (CHECK_PID(chip, 0x5209)) {
3145 retval = sd_change_bank_voltage(chip, SD_IO_3V3);
3146 if (retval != STATUS_SUCCESS) {
3147 TRACE_RET(chip, STATUS_FAIL);
3148 }
3149 }


Indeed, returning STATUS_FAIL directly would look like more consice and
neat. But in the following code (line 3164) it would not work because we
may need to call reset_mmc function. In order to keep the code
consistent, I introduce the "reset_pass" variable.
Another method to fix this bug is to add "retval = STATUS_FAIL" after
line 3167. But I don't think this style is clear enough, comparing with
adding a new variable.

3157 retval = reset_sd(chip);
3158 if (retval != STATUS_SUCCESS) {
3159 if (sd_check_err_code(chip, SD_NO_CARD)) {
3160 TRACE_RET(chip, STATUS_FAIL);
3161 }
3162
3163 if (CHECK_PID(chip, 0x5209)) {
3164 retval = sd_change_bank_voltage(chip, SD_IO_3V3);
3165 if (retval != STATUS_SUCCESS) {
3166 TRACE_RET(chip, STATUS_FAIL);
3167 }
3168 }
3169
3170 if (!chip->sd_io) {
3171 retval = reset_mmc(chip);
3172 if (retval == STATUS_SUCCESS)
3173 reset_pass = 1;
3174 }
3175 } else {
3176 reset_pass = 1;
3177 }


Best regards,
wwang

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ