Skip to content

Commit 525ba7f

Browse files
cyrilbur-ibmstewartsmith
authored andcommitted
libflash: Fix Coverity defect 97867
CID 97867 (jk-ozlabs#1 of 1): Uninitialized scalar variable (UNINIT) 5. uninit_use: Using uninitialized value rc. Signed-off-by: Cyril Bur <[email protected]> Signed-off-by: Stewart Smith <[email protected]>
1 parent ab5e8bf commit 525ba7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libflash/libflash.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,15 @@ static int flash_set_4b(struct flash_chip *c, bool enable)
694694
int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
695695
{
696696
struct spi_flash_ctrl *ct = c->ctrl;
697-
int rc;
697+
int rc = FLASH_ERR_4B_NOT_SUPPORTED;
698698

699699
/*
700700
* We only allow force 4b if both controller and flash do 4b
701701
* as this is mainly used if a 3rd party tries to directly
702702
* access a direct mapped read region
703703
*/
704704
if (enable_4b && !((c->info.flags & FL_CAN_4B) && ct->set_4b))
705-
return FLASH_ERR_4B_NOT_SUPPORTED;
705+
return rc;
706706

707707
/* Only send to flash directly on controllers that implement
708708
* the low level callbacks

0 commit comments

Comments
 (0)