From ead0b90550725c38b917340a6517da722249ad6e Mon Sep 17 00:00:00 2001 From: zhang Date: Mon, 18 Jul 2022 14:27:40 +0800 Subject: [PATCH] fix:clear the monthly branch compilation alarm Signed-off-by: zhang --- uhdf2/manager/src/servstat_listener_holder.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/uhdf2/manager/src/servstat_listener_holder.c b/uhdf2/manager/src/servstat_listener_holder.c index 52928d5..cedf2f3 100644 --- a/uhdf2/manager/src/servstat_listener_holder.c +++ b/uhdf2/manager/src/servstat_listener_holder.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,7 +33,16 @@ struct SvcStatListenerHolderList { bool inited; }; -static struct SvcStatListenerHolderList g_holoderList = { 0 }; +static struct SvcStatListenerHolderList g_holoderList = { + .mutex = { + .realMutex = NULL, + }, + .list = { + .prev = NULL, + .next = NULL, + }, + .inited = false, +}; static void UServStatListenerHolderListInit(void) { @@ -86,13 +95,13 @@ int32_t UServStatListenerHolderNotifyStatus(struct ServStatListenerHolder *holde SERVIE_STATUS_LISTENER_NOTIFY, data, NULL); if (ret != HDF_SUCCESS) { HDF_LOGE("failed to notify service status, dispatch error"); + HdfSbufRecycle(data); return HDF_FAILURE; } else { HDF_LOGD("notify service status success"); + HdfSbufRecycle(data); return HDF_SUCCESS; } - HdfSbufRecycle(data); - return HDF_SUCCESS; } void UServStatListenerHolderRecycle(struct ServStatListenerHolder *holder) -- Gitee