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>
diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c
index e8c8f01..e9e66dc 100644
--- a/src/southbridge/intel/common/spi.c
+++ b/src/southbridge/intel/common/spi.c
@@ -338,7 +338,7 @@
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);
}
}