hal-api: common: fix the error handling path 87/285887/1 accepted/tizen/unified/20230105.154657 accepted/tizen/unified/20230425.063950
authorJaehoon Chung <jh80.chung@samsung.com>
Thu, 22 Dec 2022 03:22:54 +0000 (12:22 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 22 Dec 2022 06:03:43 +0000 (15:03 +0900)
Before calling hal_api_conf_exit(), it needs to call close_backend().
Otherwise, hal_api_conf_exit will call free(info) before info->backend/handle.

Change-Id: If9b3b66d3bb7c9e5d92ebd565815c13bde4babdb
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
src/hal-api-common.c

index d11226b..47f033b 100644 (file)
@@ -320,8 +320,8 @@ static int __get_backend(enum hal_module module, void **data,
        return 0;
 
 err_dlclose:
-       _hal_api_conf_exit();
        __close_backend(info);
+       _hal_api_conf_exit();
 err:
        G_UNLOCK(hal_common_lock);
        return ret;