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-next>] [day] [month] [year] [list]
Message-Id: <1392457475-27693-1-git-send-email-levex@linux.com>
Date:	Sat, 15 Feb 2014 10:44:35 +0100
From:	Levente Kurusa <levex@...ux.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Micky Ching <micky_ching@...lsil.com.cn>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	OSUOSL Drivers <devel@...verdev.osuosl.org>,
	David Binderman <dcb314@...mail.com>,
	Levente Kurusa <levex@...ux.com>
Subject: [PATCH] staging: rts5208: fix always true condition

ANDing anything with 0x1E and expecting it to be not 0x03 will always
be true. AND instead with 0x03, so that we check the last two bits,
which should be what was intended there.

Reported-by: David Binderman <dcb314@...mail.com>
Signed-off-by: Levente Kurusa <levex@...ux.com>
---
 drivers/staging/rts5208/sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rts5208/sd.c b/drivers/staging/rts5208/sd.c
index c7c1f54..03548e5 100644
--- a/drivers/staging/rts5208/sd.c
+++ b/drivers/staging/rts5208/sd.c
@@ -3512,7 +3512,7 @@ RTY_SEND_CMD:
 					TRACE_RET(chip, STATUS_FAIL);
 
 			} else if (rsp_type == SD_RSP_TYPE_R0) {
-				if ((ptr[3] & 0x1E) != 0x03)
+				if ((ptr[3] & 0x03) != 0x03)
 					TRACE_RET(chip, STATUS_FAIL);
 			}
 		}
-- 
1.8.3.1

--
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