summaryrefslogtreecommitdiff
path: root/src/southbridge/intel
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-07-02 11:08:53 -0600
committerNico Huber <nico.h@gmx.de>2019-07-04 08:04:01 +0000
commit367497486d637ff07518872ad21f2cf2d8443e80 (patch)
tree808954f2afaf7ecb86512c0d2bec7f661c172f86 /src/southbridge/intel
parent70b421f3bd81923c01e16989dfec045d56a5c447 (diff)
sb/intel/common: Use correct bitwise operator
Like the line above it, this should be & instead of | (otherwise it will always incorrectly return true). spi_locked() is only used internally to decide which opcodes will be used to talk to the flash, and if it is falsely reported as locked, the worst case should be a denial of service (unless there are more bugs). Change-Id: I5208b523c815d15d7263594f06ccfacd8a9510b1 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 1402092 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33963 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src/southbridge/intel')
-rw-r--r--src/southbridge/intel/common/spi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index e8c8f01407..e9e66dcda3 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -338,7 +338,7 @@ static int spi_locked(void)
if (CONFIG(SOUTHBRIDGE_INTEL_I82801GX)) {
return !!(readw_(&cntlr->ich7_spi->spis) & HSFS_FLOCKDN);
} else {
- return !!(readw_(&cntlr->ich9_spi->hsfs) | HSFS_FLOCKDN);
+ return !!(readw_(&cntlr->ich9_spi->hsfs) & HSFS_FLOCKDN);
}
}