diff options
author | Andrew Jeffery <andrew@aj.id.au> | 2019-10-03 15:23:38 +0930 |
---|---|---|
committer | Vasant Hegde <hegdevasant@linux.vnet.ibm.com> | 2019-10-23 16:23:16 +0530 |
commit | 0a8f204c9d42d47177c23dd9f8fcd45113b601fc (patch) | |
tree | 80a61ad4ea416ef6559e7d0916675bfeb63c6227 /libflash | |
parent | ed04c6c30fb9ae49dcd18323559d6159e36bc486 (diff) | |
download | skiboot-0a8f204c9d42d47177c23dd9f8fcd45113b601fc.zip skiboot-0a8f204c9d42d47177c23dd9f8fcd45113b601fc.tar.gz skiboot-0a8f204c9d42d47177c23dd9f8fcd45113b601fc.tar.bz2 |
blocklevel: smart_write: Avoid indirectly testing formal parameters
[ Upstream commit 6867bd54c21b023b74e924abd6f4c3f1cd9959c2 ]
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>
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Diffstat (limited to 'libflash')
-rw-r--r-- | libflash/blocklevel.c | 2 |
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; } |