X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fcfi.c;h=a2db50f3322fde08d958cded4fa499db99cf9520;hp=0ae72d4a28be45756f8f122e8ea6d5552099577b;hb=9542cb7c3d9f4b66d2df3d8412a73d008077ab86;hpb=ff555afc02d50ca57fc6e71787d34a8e985cf115 diff --git a/src/flash/nor/cfi.c b/src/flash/nor/cfi.c index 0ae72d4a28..a2db50f332 100644 --- a/src/flash/nor/cfi.c +++ b/src/flash/nor/cfi.c @@ -1098,11 +1098,6 @@ static int cfi_protect(struct flash_bank *bank, int set, int first, int last) return ERROR_TARGET_NOT_HALTED; } - if ((first < 0) || (last < first) || (last >= bank->num_sectors)) { - LOG_ERROR("Invalid sector range"); - return ERROR_FLASH_SECTOR_INVALID; - } - if (cfi_info->qry[0] != 'Q') return ERROR_FLASH_BANK_NOT_PROBED;