From 0a8f204c9d42d47177c23dd9f8fcd45113b601fc Mon Sep 17 00:00:00 2001 From: Andrew Jeffery Date: Thu, 3 Oct 2019 15:23:38 +0930 Subject: 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 Signed-off-by: Oliver O'Halloran Signed-off-by: Vasant Hegde --- libflash/blocklevel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libflash') 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; } -- cgit v1.1