[Skiboot] [PATCH 5/6] libflash/blocklevel_write: Fix missing error handling

Balbir singh bsingharora at gmail.com
Fri May 18 09:31:04 AEST 2018


Caught by scan-build, we seem to trap the errors in rc, but
not take any recovery action during blocklevel_write.

Signed-off-by: Balbir singh <bsingharora at gmail.com>
---
 libflash/blocklevel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c
index f3fad69e..172f8fcc 100644
--- a/libflash/blocklevel.c
+++ b/libflash/blocklevel.c
@@ -263,6 +263,7 @@ int blocklevel_write(struct blocklevel_device *bl, uint64_t pos, const void *buf
 		if (rc) {
 			errno = EBADF;
 			rc = FLASH_ERR_ECC_INVALID;
+			goto out;
 		}
 
 		/*
@@ -274,6 +275,7 @@ int blocklevel_write(struct blocklevel_device *bl, uint64_t pos, const void *buf
 		if (rc) {
 			errno = EBADF;
 			rc = FLASH_ERR_ECC_INVALID;
+			goto out;
 		}
 
 		if (memcpy_to_ecc_unaligned(buffer, buf, len, ecc_diff)) {
-- 
2.17.0



More information about the Skiboot mailing list