X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Fmips_m4k.c;h=1a402933afbd265f284debee4119b13c4768e538;hb=08ee7bb982b16742f52cfdc6c649d82ffa2eb177;hp=8fa43097caf1773722b97168ed002d8b7eeca6fc;hpb=b159f5cdedd70fff9309722e927be670845f4df5;p=openocd.git diff --git a/src/target/mips_m4k.c b/src/target/mips_m4k.c index 8fa43097ca..1a402933af 100644 --- a/src/target/mips_m4k.c +++ b/src/target/mips_m4k.c @@ -1045,7 +1045,7 @@ static int mips_m4k_read_memory(struct target *target, target_addr_t address, if (size > 1) { t = malloc(count * size * sizeof(uint8_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } @@ -1112,7 +1112,7 @@ static int mips_m4k_write_memory(struct target *target, target_addr_t address, /* mips32_..._write_mem with size 4/2 requires uint32_t/uint16_t in host */ /* endianness, but byte array represents target endianness */ t = malloc(count * size * sizeof(uint8_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; } @@ -1218,7 +1218,7 @@ static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t addre if (address & 0x3u) return ERROR_TARGET_UNALIGNED_ACCESS; - if (mips32->fast_data_area == NULL) { + if (!mips32->fast_data_area) { /* Get memory for block write handler * we preserve this area between calls and gain a speed increase * of about 3kb/sec when writing flash @@ -1250,7 +1250,7 @@ static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t addre /* but byte array represents target endianness */ uint32_t *t = NULL; t = malloc(count * sizeof(uint32_t)); - if (t == NULL) { + if (!t) { LOG_ERROR("Out of memory"); return ERROR_FAIL; }