flash: avoid checking for non NULL pointer to free it
[fw/openocd] / src / flash / nor / max32xxx.c
index c840bd795d255bcae07a0baec449b04c088d7e18..bf54f63ba0d4e469631172d76dd58509cb908eed 100644 (file)
@@ -651,10 +651,7 @@ static int max32xxx_probe(struct flash_bank *bank)
        uint32_t arm_id[2];
        uint16_t arm_pid;
 
-       if (bank->sectors) {
-               free(bank->sectors);
-               bank->sectors = NULL;
-       }
+       free(bank->sectors);
 
        /* provide this for the benefit of the NOR flash framework */
        bank->size = info->flash_size;