From 36631d55e66b6c9c30cd62fd8e1b00100ffd48aa Mon Sep 17 00:00:00 2001 From: xionglei6 Date: Tue, 4 Jan 2022 20:41:34 +0800 Subject: [PATCH] init: partition name is null, skip create symbol links Signed-off-by: xionglei6 --- interfaces/innerkits/service_control/service_control.c | 2 +- ueventd/ueventd_device_handler.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/interfaces/innerkits/service_control/service_control.c b/interfaces/innerkits/service_control/service_control.c index fec0d09..254bf51 100755 --- a/interfaces/innerkits/service_control/service_control.c +++ b/interfaces/innerkits/service_control/service_control.c @@ -166,7 +166,7 @@ int ServiceControlWithExtra(const char *serviceName, int action, const char *ext int ServiceControl(const char *serviceName, int action) { - if (serviceName == 0) { + if (serviceName == NULL) { HILOG_ERROR(LOG_CORE, "Service getctl failed, service is null.\n"); return -1; } diff --git a/ueventd/ueventd_device_handler.c b/ueventd/ueventd_device_handler.c index 0e100c6..324a570 100755 --- a/ueventd/ueventd_device_handler.c +++ b/ueventd/ueventd_device_handler.c @@ -175,8 +175,16 @@ static char *FindPlatformDeviceName(char *path) static void BuildBootDeviceSymbolLink(char **links, int linkNum, const char *partitionName) { + if (links == NULL) { + INIT_LOGE("Function parameter error."); + return; + } if (linkNum > BLOCKDEVICE_LINKS - 1) { - INIT_LOGW("Too many links, ignore"); + INIT_LOGW("Too many links, ignore."); + return; + } + if (partitionName == NULL) { + INIT_LOGW("Partition name is null, skip creating links"); return; } links[linkNum] = calloc(sizeof(char), DEVICE_FILE_SIZE);