aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSpencer Oliver <spen@spen-soft.co.uk>2014-04-22 20:53:50 +0100
committerPaul Fertser <fercerpav@gmail.com>2014-04-27 09:16:47 +0000
commitcf094f22ca1088dad99c85d10adf95979ed41176 (patch)
tree5a4dbba0f8c0d317b51cf5f4d78cb437025e2cb4 /src
parent7bd295953d2f8e53e0eedb7aab41e1cc9324e913 (diff)
downloadriscv-openocd-cf094f22ca1088dad99c85d10adf95979ed41176.zip
riscv-openocd-cf094f22ca1088dad99c85d10adf95979ed41176.tar.gz
riscv-openocd-cf094f22ca1088dad99c85d10adf95979ed41176.tar.bz2
nrf51: remove dereference of null pointer
found by clang 3.4. Change-Id: Id499b546f65acd7a719498bc97e33b21d1ba565a Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk> Reviewed-on: http://openocd.zylin.com/2119 Tested-by: jenkins Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com> Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/flash/nor/nrf51.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/flash/nor/nrf51.c b/src/flash/nor/nrf51.c
index 2a4b887..adb4004 100644
--- a/src/flash/nor/nrf51.c
+++ b/src/flash/nor/nrf51.c
@@ -629,7 +629,7 @@ static int nrf51_write_page(struct flash_bank *bank, uint32_t offset, const uint
struct flash_sector *sector = nrf51_find_sector_by_address(bank, offset);
if (!sector)
- goto error;
+ return ERROR_FLASH_SECTOR_INVALID;
if (sector->is_protected)
goto error;