aboutsummaryrefslogtreecommitdiff
path: root/libflash
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2019-10-03 15:23:38 +0930
committerOliver O'Halloran <oohall@gmail.com>2019-10-14 16:27:10 +1100
commit6867bd54c21b023b74e924abd6f4c3f1cd9959c2 (patch)
treeca1a3f403a37a63f69627947341d4f0bdd0bf14b /libflash
parent518db2b216af5178a18f8b7ad06769b6acc51bcc (diff)
downloadskiboot-6867bd54c21b023b74e924abd6f4c3f1cd9959c2.zip
skiboot-6867bd54c21b023b74e924abd6f4c3f1cd9959c2.tar.gz
skiboot-6867bd54c21b023b74e924abd6f4c3f1cd9959c2.tar.bz2
blocklevel: smart_write: Avoid indirectly testing formal parameters
The early-exit tests write_buf, but write_buf is assigned to buf on declaration. Test buf directly instead to avoid unnecessary indirection. Signed-off-by: Andrew Jeffery <andrew@aj.id.au> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'libflash')
-rw-r--r--libflash/blocklevel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libflash/blocklevel.c b/libflash/blocklevel.c
index f32db3c..a72bed7 100644
--- a/libflash/blocklevel.c
+++ b/libflash/blocklevel.c
@@ -513,7 +513,7 @@ int blocklevel_smart_write(struct blocklevel_device *bl, uint64_t pos, const voi
void *erase_buf;
int rc = 0;
- if (!write_buf || !bl) {
+ if (!buf || !bl) {
errno = EINVAL;
return FLASH_ERR_PARM_ERROR;
}