summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJihoon Jung <jh8801.jung@samsung.com>2024-07-11 17:02:35 +0900
committerJihoon Jung <jh8801.jung@samsung.com>2024-07-11 17:03:03 +0900
commitd91c9d8a05036f0b8c0e6a7b07722bd86b9f9d77 (patch)
tree1d7c8df4ed4d3990a62feac237c8cde463f5e7ec
parentd0904f22ec0c5bf98442062ee6eab4e7397ffd80 (diff)
downloaduwb-tizen_9.0.tar.gz
uwb-tizen_9.0.tar.bz2
uwb-tizen_9.0.zip
Change-Id: I2553dfc2e8daec1e12986ba0eb0a9307c4c73007 Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
-rw-r--r--[-rwxr-xr-x]src/hal-api-uwb.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/hal-api-uwb.c b/src/hal-api-uwb.c
index b2c3b06..e045d93 100755..100644
--- a/src/hal-api-uwb.c
+++ b/src/hal-api-uwb.c
@@ -43,10 +43,15 @@ int hal_uwb_get_backend(void)
if (g_uwb_funcs)
return 0;
+ g_uwb_funcs = calloc(1, sizeof(hal_backend_uwb_funcs));
+ if (!g_uwb_funcs)
+ return -ENOMEM;
+
ret = hal_common_get_backend(HAL_MODULE_UWB, (void **)&g_uwb_funcs);
if (ret < 0) {
- _E("Failed to get backend\n");
- return -EINVAL;
+ free(g_uwb_funcs);
+ g_uwb_funcs = NULL;
+ return -ENOTSUP;
}
return 0;
@@ -55,16 +60,12 @@ int hal_uwb_get_backend(void)
EXPORT
int hal_uwb_put_backend(void)
{
- int ret;
-
if (!g_uwb_funcs)
return -EINVAL;
- ret = hal_common_put_backend(HAL_MODULE_UWB, (void *)g_uwb_funcs);
- if (ret < 0) {
- _E("Failed to put backend\n");
- return -EINVAL;
- }
+ hal_common_put_backend(HAL_MODULE_UWB, (void *)g_uwb_funcs);
+
+ free(g_uwb_funcs);
g_uwb_funcs = NULL;
return 0;