Browse Source

starpu_task_submit : check pointer against NULL before it is dereferenced.

Cyril Roelandt 13 years ago
parent
commit
3a412f45b4
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/core/task.c

+ 2 - 1
src/core/task.c

@@ -223,6 +223,8 @@ int _starpu_submit_job(starpu_job_t j, unsigned do_not_increment_nsubmitted)
 /* application should submit new tasks to StarPU through this function */
 int starpu_task_submit(struct starpu_task *task)
 {
+	STARPU_ASSERT(task);
+
 	int ret;
 	unsigned is_sync = task->synchronous;
         _STARPU_LOG_IN();
@@ -239,7 +241,6 @@ int starpu_task_submit(struct starpu_task *task)
 		task->detach = 0;
 	}
 
-	STARPU_ASSERT(task);
 
 	if (task->cl)
 	{