jtag/drivers/vsllink: fix memory leak
[fw/openocd] / src / target / ls1_sap.c
index 330042f00fdfd8448df50e373f8cb622557f100e..c167224d28e0723b79b2966e50f6b77eae0c189c 100644 (file)
@@ -182,9 +182,9 @@ static int ls1_sap_read_memory(struct target *target, target_addr_t address,
                               uint32_t size, uint32_t count, uint8_t *buffer)
 {
        LOG_DEBUG("Reading memory at physical address 0x%" TARGET_PRIxADDR
-                 "; size %" PRId32 "; count %" PRId32, address, size, count);
+                 "; size %" PRIu32 "; count %" PRIu32, address, size, count);
 
-       if (count == 0 || buffer == NULL)
+       if (count == 0 || !buffer)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        ls1_sap_set_addr_high(target->tap, 0);
@@ -204,10 +204,10 @@ static int ls1_sap_write_memory(struct target *target, target_addr_t address,
                                const uint8_t *buffer)
 {
        LOG_DEBUG("Writing memory at physical address 0x%" TARGET_PRIxADDR
-                 "; size %" PRId32 "; count %" PRId32, address, size, count);
+                 "; size %" PRIu32 "; count %" PRIu32, address, size, count);
 
 
-       if (count == 0 || buffer == NULL)
+       if (count == 0 || !buffer)
                return ERROR_COMMAND_SYNTAX_ERROR;
 
        ls1_sap_set_addr_high(target->tap, 0);