aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/dell
diff options
context:
space:
mode:
authorJohn Zhao <john.zhao@intel.com>2020-09-22 09:52:06 -0700
committerMichał Żygowski <michal.zygowski@3mdeb.com>2020-09-23 09:36:33 +0000
commit000193aa902c65417f94cea050edf71b07df08d4 (patch)
tree3a7b82a5e954aaf6b0e3eb79dcec36381ee5984f /src/mainboard/dell
parenteb66233b5cd4ea83ccebfcbc9814f74715802960 (diff)
mb/dell: Fix uninitialized variables usage
Coverity detects uninitialized variables through PASS_BY_REFERENCE usage. Fix this issue by initializing variables before their uage. Found-by: Coverity CID 1429765, 1429772, 1429780 TEST=None Signed-off-by: John Zhao <john.zhao@intel.com> Change-Id: Ie583b072a76949fb3f17c1271a6427ee942db0ce Reviewed-on: https://review.coreboot.org/c/coreboot/+/45611 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Diffstat (limited to 'src/mainboard/dell')
-rw-r--r--src/mainboard/dell/optiplex_9010/sch5545_ec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mainboard/dell/optiplex_9010/sch5545_ec.c b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
index c77aef1d43..8894d8b5d4 100644
--- a/src/mainboard/dell/optiplex_9010/sch5545_ec.c
+++ b/src/mainboard/dell/optiplex_9010/sch5545_ec.c
@@ -421,7 +421,7 @@ static uint8_t ec_read_write_reg(uint8_t ldn, uint16_t reg, uint8_t *value, uint
uint16_t sch5545_get_ec_fw_version(void)
{
- uint8_t val;
+ uint8_t val = 0;
uint16_t ec_fw_version;
/* Read the FW version currently loaded used by EC */
@@ -499,7 +499,7 @@ void sch5545_update_ec_firmware(uint16_t ec_version)
void sch5545_ec_hwm_early_init(void)
{
- uint8_t val;
+ uint8_t val = 0;
int i;
printk(BIOS_DEBUG, "%s\n", __func__);
@@ -605,7 +605,7 @@ static void prepare_for_hwm_ec_sequence(uint8_t write_only, uint8_t *value)
void sch5545_ec_hwm_init(void *unused)
{
- uint8_t val, val_2fc, chassis_type, fan_speed_full = 0;
+ uint8_t val = 0, val_2fc, chassis_type, fan_speed_full = 0;
printk(BIOS_DEBUG, "%s\n", __func__);
sch5545_emi_init(0x2e);