memory: fix incorrect pointer comparison when freeing cuda memory
authorSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 26 Jul 2020 06:14:15 +0000 (07:14 +0100)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Sun, 26 Jul 2020 10:55:10 +0000 (11:55 +0100)
This fixes the following warning spotted by gcc 7:
memory.c: In function â€˜free_mem_cudamalloc’:
memory.c:277:22: error: comparison between pointer and integer [-Werror]
  if (td->dev_mem_ptr != NULL)
                      ^~

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
memory.c

index 5f0225f71094d4352a61e99eccc12527ff5bd908..6cf7333375d035dd6eb36526eb338f355f310e78 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -274,7 +274,7 @@ static int alloc_mem_cudamalloc(struct thread_data *td, size_t total_mem)
 static void free_mem_cudamalloc(struct thread_data *td)
 {
 #ifdef CONFIG_CUDA
-       if (td->dev_mem_ptr != NULL)
+       if (td->dev_mem_ptr)
                cuMemFree(td->dev_mem_ptr);
 
        if (cuCtxDestroy(td->cu_ctx) != CUDA_SUCCESS)