Currently, dfu context is assigned after thread creation, tfm can
be died due to wrong memory access if thread is scheduled in advance.
This fixes this by assigning ctx before thread creation.
Change-Id: I44f86223b90d6dac537699369a478d4cdb7829c2
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
return NULL;
}
- pthread_create(&ctx->thread, NULL, dfu_thread_main, e);
-
- e->ctx = ctx;
-
fprintf(stdout, "Start download: %s...", filename);
fflush(stdout);
+ e->ctx = ctx;
+ pthread_create(&ctx->thread, NULL, dfu_thread_main, e);
+
return e;
}