This is an automated email from Gerrit.

Tomas Vanek ([email protected]) just uploaded a new patch set to Gerrit, which you 
can find at http://openocd.zylin.com/5357

-- gerrit

commit 1c4a99e8fa8c293e39fa9896aab3a8ebd8f129b3
Author: Tomas Vanek <[email protected]>
Date:   Tue Dec 10 20:12:58 2019 +0100

    flash/nor/kinetis: fix clang static analyzer warnings
    
    Use assert to remove "Dereference of null pointer" warnings.
    
    Change-Id: Ie204c234a71758e6470351e1d9f22da3dd887f56
    Signed-off-by: Tomas Vanek <[email protected]>

diff --git a/src/flash/nor/kinetis.c b/src/flash/nor/kinetis.c
index 687a337..1d63352 100644
--- a/src/flash/nor/kinetis.c
+++ b/src/flash/nor/kinetis.c
@@ -1443,6 +1443,8 @@ static int kinetis_fill_fcf(struct flash_bank *bank, 
uint8_t *fcf)
 
                kinetis_auto_probe(bank_iter);
 
+               assert(bank_iter->prot_blocks);
+
                if (k_bank->flash_class == FC_PFLASH) {
                        for (i = 0; i < bank_iter->num_prot_blocks; i++) {
                                if (bank_iter->prot_blocks[i].is_protected == 1)
@@ -2624,7 +2626,10 @@ static int kinetis_probe(struct flash_bank *bank)
        unsigned num_blocks, first_nvm_bank;
        uint32_t size_k;
        struct kinetis_flash_bank *k_bank = bank->driver_priv;
-       struct kinetis_chip *k_chip = k_bank->k_chip;
+       struct kinetis_chip *k_chip;
+
+       assert(k_bank);
+       k_chip = k_bank->k_chip;
 
        k_bank->probed = false;
 

-- 


_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to