X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Fflash%2Fnor%2Fstm32f1x.c;fp=src%2Fflash%2Fnor%2Fstm32f1x.c;h=afc6ec9b6c628638f3584534514ece61462b16b3;hb=08ee7bb982b16742f52cfdc6c649d82ffa2eb177;hp=d50e0d80e4798d02c5460af0647de7b26da10e6b;hpb=b159f5cdedd70fff9309722e927be670845f4df5;p=fw%2Fopenocd diff --git a/src/flash/nor/stm32f1x.c b/src/flash/nor/stm32f1x.c index d50e0d80e..afc6ec9b6 100644 --- a/src/flash/nor/stm32f1x.c +++ b/src/flash/nor/stm32f1x.c @@ -561,7 +561,7 @@ static int stm32x_write(struct flash_bank *bank, const uint8_t *buffer, * discrete accesses. */ if (count & 1) { new_buffer = malloc(count + 1); - if (new_buffer == NULL) { + if (!new_buffer) { LOG_ERROR("odd number of bytes to write and no memory for padding buffer"); return ERROR_FAIL; } @@ -1179,7 +1179,7 @@ static int get_stm32x_info(struct flash_bank *bank, struct command_invocation *c return ERROR_FAIL; } - if (rev_str != NULL) + if (rev_str) command_print_sameline(cmd, "%s - Rev: %s", device_str, rev_str); else command_print_sameline(cmd, "%s - Rev: unknown (0x%04x)", device_str, rev_id);