Don't cast return value of [cm]alloc
[openocd.git] / src / target / nds32.c
index 2295763addc9e9864ae45c5ca33a673e8e70b49a..8ab285999e2072e0f30736905b371b88abcde926 100644 (file)
@@ -2330,14 +2330,14 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
 
        switch (syscall_id) {
                case NDS32_SYSCALL_EXIT:
-                       fileio_info->identifier = (char *)malloc(5);
+                       fileio_info->identifier = malloc(5);
                        sprintf(fileio_info->identifier, "exit");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        break;
                case NDS32_SYSCALL_OPEN:
                        {
                                uint8_t filename[256];
-                               fileio_info->identifier = (char *)malloc(5);
+                               fileio_info->identifier = malloc(5);
                                sprintf(fileio_info->identifier, "open");
                                nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                                /* reserve fileio_info->param_2 for length of path */
@@ -2350,26 +2350,26 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                        }
                        break;
                case NDS32_SYSCALL_CLOSE:
-                       fileio_info->identifier = (char *)malloc(6);
+                       fileio_info->identifier = malloc(6);
                        sprintf(fileio_info->identifier, "close");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        break;
                case NDS32_SYSCALL_READ:
-                       fileio_info->identifier = (char *)malloc(5);
+                       fileio_info->identifier = malloc(5);
                        sprintf(fileio_info->identifier, "read");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
                        nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
                        break;
                case NDS32_SYSCALL_WRITE:
-                       fileio_info->identifier = (char *)malloc(6);
+                       fileio_info->identifier = malloc(6);
                        sprintf(fileio_info->identifier, "write");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
                        nds32_get_mapped_reg(nds32, R2, &(fileio_info->param_3));
                        break;
                case NDS32_SYSCALL_LSEEK:
-                       fileio_info->identifier = (char *)malloc(6);
+                       fileio_info->identifier = malloc(6);
                        sprintf(fileio_info->identifier, "lseek");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
@@ -2378,7 +2378,7 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                case NDS32_SYSCALL_UNLINK:
                        {
                                uint8_t filename[256];
-                               fileio_info->identifier = (char *)malloc(7);
+                               fileio_info->identifier = malloc(7);
                                sprintf(fileio_info->identifier, "unlink");
                                nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                                /* reserve fileio_info->param_2 for length of path */
@@ -2391,7 +2391,7 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                case NDS32_SYSCALL_RENAME:
                        {
                                uint8_t filename[256];
-                               fileio_info->identifier = (char *)malloc(7);
+                               fileio_info->identifier = malloc(7);
                                sprintf(fileio_info->identifier, "rename");
                                nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                                /* reserve fileio_info->param_2 for length of old path */
@@ -2408,7 +2408,7 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                        }
                        break;
                case NDS32_SYSCALL_FSTAT:
-                       fileio_info->identifier = (char *)malloc(6);
+                       fileio_info->identifier = malloc(6);
                        sprintf(fileio_info->identifier, "fstat");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
@@ -2416,7 +2416,7 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                case NDS32_SYSCALL_STAT:
                        {
                                uint8_t filename[256];
-                               fileio_info->identifier = (char *)malloc(5);
+                               fileio_info->identifier = malloc(5);
                                sprintf(fileio_info->identifier, "stat");
                                nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                                /* reserve fileio_info->param_2 for length of old path */
@@ -2428,20 +2428,20 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                        }
                        break;
                case NDS32_SYSCALL_GETTIMEOFDAY:
-                       fileio_info->identifier = (char *)malloc(13);
+                       fileio_info->identifier = malloc(13);
                        sprintf(fileio_info->identifier, "gettimeofday");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        nds32_get_mapped_reg(nds32, R1, &(fileio_info->param_2));
                        break;
                case NDS32_SYSCALL_ISATTY:
-                       fileio_info->identifier = (char *)malloc(7);
+                       fileio_info->identifier = malloc(7);
                        sprintf(fileio_info->identifier, "isatty");
                        nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                        break;
                case NDS32_SYSCALL_SYSTEM:
                        {
                                uint8_t command[256];
-                               fileio_info->identifier = (char *)malloc(7);
+                               fileio_info->identifier = malloc(7);
                                sprintf(fileio_info->identifier, "system");
                                nds32_get_mapped_reg(nds32, R0, &(fileio_info->param_1));
                                /* reserve fileio_info->param_2 for length of old path */
@@ -2452,12 +2452,12 @@ int nds32_get_gdb_fileio_info(struct target *target, struct gdb_fileio_info *fil
                        }
                        break;
                case NDS32_SYSCALL_ERRNO:
-                       fileio_info->identifier = (char *)malloc(6);
+                       fileio_info->identifier = malloc(6);
                        sprintf(fileio_info->identifier, "errno");
                        nds32_set_mapped_reg(nds32, R0, nds32->virtual_hosting_errno);
                        break;
                default:
-                       fileio_info->identifier = (char *)malloc(8);
+                       fileio_info->identifier = malloc(8);
                        sprintf(fileio_info->identifier, "unknown");
                        break;
        }

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)