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>
This commit is contained in:
Spencer Oliver 2014-04-22 20:53:50 +01:00 committed by Paul Fertser
parent 7bd295953d
commit cf094f22ca
1 changed files with 1 additions and 1 deletions

View File

@ -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;