aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorBalbir singh <bsingharora@gmail.com>2018-05-18 09:31:04 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-05-24 04:03:19 -0500
commit7ed804a6fbc078a8b0468d45ac54f29112a47e5e (patch)
tree879cc217fdd2c500b96da135904fcba2ce455a41 /libflash
parent9da2eb12f14f6c905cdc19411cdf6a5d8c829e71 (diff)
downloadskiboot-7ed804a6fbc078a8b0468d45ac54f29112a47e5e.zip
skiboot-7ed804a6fbc078a8b0468d45ac54f29112a47e5e.tar.gz
skiboot-7ed804a6fbc078a8b0468d45ac54f29112a47e5e.tar.bz2
libflash/blocklevel_write: Fix missing error handling
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@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/blocklevel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c
index f3fad69..172f8fc 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)) {