This is an automated email from Gerrit.

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

-- gerrit

commit 06543c9db18a806a06fb0ec9ed64ff12bbf828ee
Author: Paul Fertser <[email protected]>
Date:   Fri Jan 17 14:06:51 2014 +0400

    flash/nor/mdr.c: fix uninitialised variable warning
    
    Caught (actually, it's breaking the build) by clang 3.3.
    
    Change-Id: Ife6fabf8a57e6c90ab45aaaf75557c984ac6772c
    Signed-off-by: Paul Fertser <[email protected]>

diff --git a/src/flash/nor/mdr.c b/src/flash/nor/mdr.c
index 3ecee1c..50651f0 100644
--- a/src/flash/nor/mdr.c
+++ b/src/flash/nor/mdr.c
@@ -159,7 +159,7 @@ static int mdr_erase(struct flash_bank *bank, int first, 
int last)
 
        retval = target_write_u32(target, FLASH_KEY, KEY);
        if (retval != ERROR_OK)
-               goto reset_pg_and_lock;
+               return retval;
 
        retval = target_read_u32(target, FLASH_CMD, &flash_cmd);
        if (retval != ERROR_OK)
@@ -367,7 +367,7 @@ static int mdr_write(struct flash_bank *bank, uint8_t 
*buffer,
 
        retval = target_write_u32(target, FLASH_KEY, KEY);
        if (retval != ERROR_OK)
-               goto reset_pg_and_lock;
+               goto free_buffer;
 
        retval = target_read_u32(target, FLASH_CMD, &flash_cmd);
        if (retval != ERROR_OK)
@@ -466,6 +466,7 @@ reset_pg_and_lock:
        if (retval == ERROR_OK)
                retval = retval2;
 
+free_buffer:
        if (new_buffer)
                free(new_buffer);
 

-- 

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to