aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBuddy Liong2016-02-27 18:40:06 -0600
committerBuddy Liong2016-03-01 14:15:58 -0600
commit792ecc2fb418e0b21021c2c798289adecda334c6 (patch)
treea9dac2f5b381fccfd215e3aaf1a32eac762c857d
parentdf2cf959a86342d2fcf2ca75bea08bd7c234ac83 (diff)
downloadipumm-792ecc2fb418e0b21021c2c798289adecda334c6.tar.gz
ipumm-792ecc2fb418e0b21021c2c798289adecda334c6.tar.xz
ipumm-792ecc2fb418e0b21021c2c798289adecda334c6.zip
Handling error in ivahd_init
In ivahd_init, when RMAN_init() or RMAN_register() fails, there is no proper cleanup. Adding proper cleanup when those functions are failing. Change-Id: I2a644578cc9721e17129cb243baabc67923ee575 Signed-off-by: Buddy Liong <a0270631@ti.com>
-rw-r--r--src/ti/framework/dce/ivahd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ti/framework/dce/ivahd.c b/src/ti/framework/dce/ivahd.c
index 352829b..3fa87f2 100644
--- a/src/ti/framework/dce/ivahd.c
+++ b/src/ti/framework/dce/ivahd.c
@@ -472,13 +472,17 @@ void ivahd_init(uint32_t chipset_id)
472 472
473 ret = RMAN_init(); 473 ret = RMAN_init();
474 if( ret != IRES_OK ) { 474 if( ret != IRES_OK ) {
475 ERROR("RMAN_init is failing ret %d", ret);
476 CERuntime_exit();
475 goto end; 477 goto end;
476 } 478 }
477 479
478 /* Register HDVICP with RMAN if not already registered */ 480 /* Register HDVICP with RMAN if not already registered */
479 ret = RMAN_register(&IRESMAN_HDVICP, &rman_params); 481 ret = RMAN_register(&IRESMAN_HDVICP, &rman_params);
480 if((ret != IRES_OK) && (ret != IRES_EEXISTS)) { 482 if((ret != IRES_OK) && (ret != IRES_EEXISTS)) {
481 DEBUG("could not register IRESMAN_HDVICP: %d", ret); 483 ERROR("could not register IRESMAN_HDVICP: %d", ret);
484 RMAN_exit();
485 CERuntime_exit();
482 goto end; 486 goto end;
483 } 487 }
484 488
@@ -489,7 +493,13 @@ void ivahd_init(uint32_t chipset_id)
489 */ 493 */
490 ret = RMAN_register(&IRESMAN_TILEDMEMORY, &rman_params); 494 ret = RMAN_register(&IRESMAN_TILEDMEMORY, &rman_params);
491 if((ret != IRES_OK) && (ret != IRES_EEXISTS)) { 495 if((ret != IRES_OK) && (ret != IRES_EEXISTS)) {
492 DEBUG("could not register IRESMAN_TILEDMEMORY: %d", ret); 496 ERROR("could not register IRESMAN_TILEDMEMORY: %d", ret);
497 ret = RMAN_unregister(&IRESMAN_HDVICP);
498 if( ret != IRES_OK ) {
499 ERROR("RMAN_unregister on IRESMAN_HDVICP fail with ret %d", ret);
500 }
501 RMAN_exit();
502 CERuntime_exit();
493 goto end; 503 goto end;
494 } 504 }
495 505