Browse Source

make sure variables are initialized

Nathalie Furmento 8 years ago
parent
commit
c7a7300aeb
3 changed files with 4 additions and 4 deletions
  1. 1 1
      mpi/tests/block_interface.c
  2. 2 2
      mpi/tests/block_interface_pinned.c
  3. 1 1
      src/core/disk.c

+ 1 - 1
mpi/tests/block_interface.c

@@ -56,7 +56,7 @@ int main(int argc, char **argv)
 	 * their blocks. */
 
 	float *block = NULL;
-	starpu_data_handle_t block_handle;
+	starpu_data_handle_t block_handle = NULL;
 
 	if (rank == 0)
 	{

+ 2 - 2
mpi/tests/block_interface_pinned.c

@@ -56,8 +56,8 @@ int main(int argc, char **argv)
 	 * register it directly. Node 0 and 1 will then exchange the content of
 	 * their blocks. */
 
-	float *block;
-	starpu_data_handle_t block_handle;
+	float *block = NULL;
+	starpu_data_handle_t block_handle = NULL;
 
 	if (rank == 0)
 	{

+ 1 - 1
src/core/disk.c

@@ -147,7 +147,7 @@ void _starpu_disk_free(unsigned node, void *obj, size_t size)
 /* src_node == disk node and dst_node == STARPU_MAIN_RAM */
 int _starpu_disk_read(unsigned src_node, unsigned dst_node STARPU_ATTRIBUTE_UNUSED, void *obj, void *buf, off_t offset, size_t size, struct _starpu_async_channel *channel)
 {
-        void * event;
+        void *event = NULL;
 	int pos = get_location_with_node(src_node);
 
         if (channel != NULL)