flash: avoid checking for non NULL pointer to free it
[fw/openocd] / src / flash / nor / stellaris.c
index 34c9c28febf3be660b64150c57fc822556f5d23c..55b99de3fc719dee3c9097fc3752211386dbb7b6 100644 (file)
@@ -1250,10 +1250,7 @@ static int stellaris_probe(struct flash_bank *bank)
        if (retval != ERROR_OK)
                return retval;
 
-       if (bank->sectors) {
-               free(bank->sectors);
-               bank->sectors = NULL;
-       }
+       free(bank->sectors);
 
        /* provide this for the benefit of the NOR flash framework */
        bank->size = stellaris_info->num_pages * stellaris_info->pagesize;