fix lpc2000 flash programming fail. 76/1676/2
authorSergey A. Borshch <sb-sf@users.sourceforge.net>
Thu, 3 Oct 2013 13:05:15 +0000 (16:05 +0300)
committerSpencer Oliver <spen@spen-soft.co.uk>
Mon, 7 Oct 2013 19:27:00 +0000 (19:27 +0000)
 some members of lpc2000_info structure sometimes used uninitialized
 (cmd51_can_64b for all LPC except LPC800 as example).
  Init allocated lpc2000_info structure with zeros to avoid this and similar bugs in the future.
  Note: maybe discarding all cmd51_can_XXXb fields and using cmd51_dst_boundary instead will be a better solution.

Signed-off-by: Sergey A. Borshch <sb-sf@users.sourceforge.net>
Change-Id: Idf116a5b0bf4ea1c39ea0ce308ec2c13bfbd4d8c
Reviewed-on: http://openocd.zylin.com/1676
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Nemui Trinomius <nemuisan_kawausogasuki@live.jp>
src/flash/nor/lpc2000.c

index 3962f305c809ba3cef780cccb7cb6aa81c04c01d..12814aad168b28d9c044b39b8846ba0fa49e4622 100644 (file)
@@ -559,7 +559,8 @@ FLASH_BANK_COMMAND_HANDLER(lpc2000_flash_bank_command)
        if (CMD_ARGC < 8)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
-       struct lpc2000_flash_bank *lpc2000_info = malloc(sizeof(struct lpc2000_flash_bank));
+       struct lpc2000_flash_bank *lpc2000_info = calloc(1, sizeof(*lpc2000_info));
+
        bank->driver_priv = lpc2000_info;
 
        if (strcmp(CMD_ARGV[6], "lpc2000_v1") == 0) {

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)