summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c17cb8b)
raw | patch | inline | side by side (parent: c17cb8b)
author | Buddy Liong <a0270631@ti.com> | |
Thu, 30 Jun 2016 16:11:22 +0000 (11:11 -0500) | ||
committer | Buddy Liong <a0270631@ti.com> | |
Tue, 5 Jul 2016 20:59:00 +0000 (15:59 -0500) |
Prior to this patch, when Engine_open fails and return NULL Engine_Handle.
DCE will still caling dce_register_engine with NULL data which is not
necessary. The only issue here is that the c->refs count will be invalid.
This patch check on Engine_Handle to make sure it is not NULL before
calling dce_register_engine
Change-Id: I07680326ef991dbf32d9c7ceb2a1877bbd368f29
Signed-off-by: Buddy Liong <a0270631@ti.com>
DCE will still caling dce_register_engine with NULL data which is not
necessary. The only issue here is that the c->refs count will be invalid.
This patch check on Engine_Handle to make sure it is not NULL before
calling dce_register_engine
Change-Id: I07680326ef991dbf32d9c7ceb2a1877bbd368f29
Signed-off-by: Buddy Liong <a0270631@ti.com>
src/ti/framework/dce/dce.c | patch | blob | history |
index 45709293ec93e931fbb62072516f4e29233b7337..d9876a840846f0d222f6f5c8edf25e756e7be08f 100644 (file)
eng_handle = Engine_open(engine_open_msg->name, engine_open_msg->engine_attrs, &engine_open_msg->error_code);
- mm_serv_id = MmServiceMgr_getId();
- DEBUG("engine_open mm_serv_id 0x%x", mm_serv_id);
-
- ret = dce_register_engine(mm_serv_id, eng_handle);
- if( ret < 0 ) {
- Engine_close(eng_handle);
- eng_handle = NULL;
+ if( eng_handle ) {
+ mm_serv_id = MmServiceMgr_getId();
+ DEBUG("engine_open mm_serv_id 0x%x eng_handle %08x", mm_serv_id, eng_handle);
+
+ ret = dce_register_engine(mm_serv_id, eng_handle);
+ if( ret < 0 ) {
+ Engine_close(eng_handle);
+ eng_handle = NULL;
+ }
}
DEBUG("<< engine=%08x, ec=%d", eng_handle, engine_open_msg->error_code);