diff options
author | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 16:54:58 +0900 |
---|---|---|
committer | Jihoon Jung <jh8801.jung@samsung.com> | 2024-07-11 17:05:33 +0900 |
commit | 887e9d6d189213e7b685cf39c9c4471f1ff856a8 (patch) | |
tree | ae55062aefefa02b595b0b84492734412ee6c8c9 | |
parent | ef265c7086810b6a82714f33d5a8316a44de33d7 (diff) | |
download | zigbee-accepted/tizen_unified.tar.gz zigbee-accepted/tizen_unified.tar.bz2 zigbee-accepted/tizen_unified.zip |
Apply multi-hal interfacetizen_9.0_m2_releaseaccepted/tizen/unified/x/asan/20240813.231917accepted/tizen/unified/x/20240715.042530accepted/tizen/unified/toolchain/20240812.133434accepted/tizen/unified/dev/20240715.080554accepted/tizen/unified/20240712.160125accepted/tizen/9.0/unified/20241030.234036tizen_9.0tizenaccepted/tizen_unified_x_asanaccepted/tizen_unified_xaccepted/tizen_unified_toolchainaccepted/tizen_unified_devaccepted/tizen_unifiedaccepted/tizen_9.0_unified
Change-Id: Ib338fe6998ca41c820ebe19fda10ba85d11752ca
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--[-rwxr-xr-x] | src/hal-api-zigbee.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/hal-api-zigbee.c b/src/hal-api-zigbee.c index 890baa7..ccd09d3 100755..100644 --- a/src/hal-api-zigbee.c +++ b/src/hal-api-zigbee.c @@ -43,10 +43,15 @@ int hal_zigbee_get_backend(void) if (g_zigbee_funcs) return 0; + g_zigbee_funcs = calloc(1, sizeof(hal_backend_zigbee_funcs)); + if (!g_zigbee_funcs) + return -ENOMEM; + ret = hal_common_get_backend(HAL_MODULE_ZIGBEE, (void **)&g_zigbee_funcs); if (ret < 0) { - _E("Failed to get backend\n"); - return -EINVAL; + free(g_zigbee_funcs); + g_zigbee_funcs = NULL; + return -ENOTSUP; } return 0; @@ -55,16 +60,12 @@ int hal_zigbee_get_backend(void) EXPORT int hal_zigbee_put_backend(void) { - int ret; - if (!g_zigbee_funcs) return -EINVAL; - ret = hal_common_put_backend(HAL_MODULE_ZIGBEE, (void *)g_zigbee_funcs); - if (ret < 0) { - _E("Failed to put backend\n"); - return -EINVAL; - } + hal_common_put_backend(HAL_MODULE_ZIGBEE, (void *)g_zigbee_funcs); + + free(g_zigbee_funcs); g_zigbee_funcs = NULL; return 0; |