aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorCyril Bur <cyril.bur@au1.ibm.com>2015-09-08 16:14:01 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-09-08 16:22:41 +1000
commit525ba7f2d6d8b98027bcfc906d3b7a0fe1538828 (patch)
tree432e6abb54c723a6705499b967f8990cdb4b497a /libflash
parentab5e8bf7f0607579cff5878154054b8883687f81 (diff)
downloadskiboot-525ba7f2d6d8b98027bcfc906d3b7a0fe1538828.zip
skiboot-525ba7f2d6d8b98027bcfc906d3b7a0fe1538828.tar.gz
skiboot-525ba7f2d6d8b98027bcfc906d3b7a0fe1538828.tar.bz2
libflash: Fix Coverity defect 97867
CID 97867 (#1 of 1): Uninitialized scalar variable (UNINIT) 5. uninit_use: Using uninitialized value rc. Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/libflash.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libflash/libflash.c b/libflash/libflash.c
index c43f212..c05c927 100644
--- a/libflash/libflash.c
+++ b/libflash/libflash.c
@@ -694,7 +694,7 @@ static int flash_set_4b(struct flash_chip *c, bool enable)
int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
{
struct spi_flash_ctrl *ct = c->ctrl;
- int rc;
+ int rc = FLASH_ERR_4B_NOT_SUPPORTED;
/*
* We only allow force 4b if both controller and flash do 4b
@@ -702,7 +702,7 @@ int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
* access a direct mapped read region
*/
if (enable_4b && !((c->info.flags & FL_CAN_4B) && ct->set_4b))
- return FLASH_ERR_4B_NOT_SUPPORTED;
+ return rc;
/* Only send to flash directly on controllers that implement
* the low level callbacks