mirror of
https://dev.iopsys.eu/bbf/icwmp.git
synced 2025-12-10 07:44:41 +01:00
Static error fixes
This commit is contained in:
parent
c061950b19
commit
dea357d30f
7 changed files with 28 additions and 31 deletions
26
src/common.c
26
src/common.c
|
|
@ -279,18 +279,18 @@ static void delete_dm_alias_from_list(struct cwmp_dm_alias *dm_alias)
|
|||
|
||||
void cwmp_free_all_dm_parameter_list(struct list_head *list)
|
||||
{
|
||||
while (list->next != list) {
|
||||
struct cwmp_dm_parameter *dm_parameter;
|
||||
dm_parameter = list_entry(list->next, struct cwmp_dm_parameter, list);
|
||||
struct cwmp_dm_parameter *dm_parameter = NULL, *node;
|
||||
|
||||
list_for_each_entry_safe(dm_parameter, node, list, list) {
|
||||
delete_dm_parameter_from_list(dm_parameter);
|
||||
}
|
||||
}
|
||||
|
||||
void cwmp_free_all_dm_alias_list(struct list_head *list)
|
||||
{
|
||||
while (list->next != list) {
|
||||
struct cwmp_dm_alias *dm_alias;
|
||||
dm_alias = list_entry(list->next, struct cwmp_dm_alias, list);
|
||||
struct cwmp_dm_alias *dm_alias = NULL, *node;
|
||||
|
||||
list_for_each_entry_safe(dm_alias, node, list, list) {
|
||||
delete_dm_alias_from_list(dm_alias);
|
||||
}
|
||||
}
|
||||
|
|
@ -318,9 +318,9 @@ static void cwmp_del_list_fault_param(struct cwmp_param_fault *param_fault)
|
|||
|
||||
void cwmp_free_all_list_param_fault(struct list_head *list_param_fault)
|
||||
{
|
||||
while (list_param_fault->next != list_param_fault) {
|
||||
struct cwmp_param_fault *param_fault;
|
||||
param_fault = list_entry(list_param_fault->next, struct cwmp_param_fault, list);
|
||||
struct cwmp_param_fault *param_fault = NULL, *node;
|
||||
|
||||
list_for_each_entry_safe(param_fault, node, list_param_fault, list) {
|
||||
cwmp_del_list_fault_param(param_fault);
|
||||
}
|
||||
}
|
||||
|
|
@ -634,15 +634,13 @@ void icwmp_free(void *m)
|
|||
|
||||
void icwmp_cleanmem()
|
||||
{
|
||||
struct cwmp_mem *mem;
|
||||
while (cwmp_memory_list.next != &cwmp_memory_list) {
|
||||
mem = list_entry(cwmp_memory_list.next, struct cwmp_mem, list);
|
||||
if (mem != NULL) {
|
||||
struct cwmp_mem *mem = NULL, *node;
|
||||
|
||||
list_for_each_entry_safe(mem, node, &cwmp_memory_list, list) {
|
||||
list_del(&mem->list);
|
||||
free(mem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Services Management
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ static void global_conf_init()
|
|||
|
||||
void cwmp_config_load()
|
||||
{
|
||||
int error = CWMP_GEN_ERR;
|
||||
int error;
|
||||
|
||||
global_conf_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -296,6 +296,9 @@ const struct cwmp_cli_command_struct icwmp_commands[] = {
|
|||
|
||||
char *execute_cwmp_cli_command(char *cmd, char *args[])
|
||||
{
|
||||
char *fault = NULL, *fault_ret = NULL;
|
||||
union cmd_result cmd_out = {0};
|
||||
|
||||
if (CWMP_STRLEN(cmd) == 0) {
|
||||
printf("You must add a command as input: \n\n");
|
||||
goto cli_help;
|
||||
|
|
@ -309,8 +312,6 @@ char *execute_cwmp_cli_command(char *cmd, char *args[])
|
|||
args[0] && args[1] ? args[1] : "",
|
||||
args[0] && args[1] && args[2] ? args[2] : NULL
|
||||
};
|
||||
union cmd_result cmd_out = {0};
|
||||
char *fault = NULL, *fault_ret = NULL;
|
||||
|
||||
for (size_t i = 0; i < ARRAY_SIZE(icwmp_commands); i++) {
|
||||
if (CWMP_STRCMP(icwmp_commands[i].command_name, cmd) == 0) {
|
||||
|
|
|
|||
|
|
@ -260,7 +260,7 @@ static bool environment_exists(char *environment_path)
|
|||
static int cwmp_launch_du_install(char *url, char *uuid, char *user, char *pass, char *path, char *env_ref, struct opresult **pchange_du_state_complete)
|
||||
{
|
||||
int error = FAULT_CPE_NO_FAULT;
|
||||
char *fault_code;
|
||||
char *fault_code = NULL;
|
||||
|
||||
(*pchange_du_state_complete)->start_time = strdup(get_time(time(NULL)));
|
||||
|
||||
|
|
@ -303,7 +303,7 @@ static int cwmp_launch_du_install(char *url, char *uuid, char *user, char *pass,
|
|||
static int cwmp_launch_du_update(char *url, char *uuid, char *user, char *pass, char *du_path, struct opresult **pchange_du_state_complete)
|
||||
{
|
||||
int error = FAULT_CPE_NO_FAULT;
|
||||
char *fault_code;
|
||||
char *fault_code = NULL;
|
||||
|
||||
(*pchange_du_state_complete)->start_time = strdup(get_time(time(NULL)));
|
||||
|
||||
|
|
@ -345,7 +345,7 @@ static int cwmp_launch_du_update(char *url, char *uuid, char *user, char *pass,
|
|||
static int cwmp_launch_du_uninstall(char *du_path, char *uuid, struct opresult **pchange_du_state_complete)
|
||||
{
|
||||
int error = FAULT_CPE_NO_FAULT;
|
||||
char *fault_code;
|
||||
char *fault_code = NULL;
|
||||
|
||||
(*pchange_du_state_complete)->start_time = strdup(get_time(time(NULL)));
|
||||
|
||||
|
|
|
|||
|
|
@ -805,11 +805,9 @@ void del_list_lw_notify(struct cwmp_dm_parameter *dm_parameter)
|
|||
|
||||
static void free_all_list_lw_notify()
|
||||
{
|
||||
while (list_lw_value_change.next != &list_lw_value_change) {
|
||||
struct cwmp_dm_parameter *dm_parameter;
|
||||
if (list_lw_value_change.next == NULL)
|
||||
continue;
|
||||
dm_parameter = list_entry(list_lw_value_change.next, struct cwmp_dm_parameter, list);
|
||||
struct cwmp_dm_parameter *dm_parameter = NULL, *node;
|
||||
|
||||
list_for_each_entry_safe(dm_parameter, node, &list_lw_value_change, list) {
|
||||
del_list_lw_notify(dm_parameter);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ error:
|
|||
int cwmp_rpc_acs_parse_response_inform(struct rpc *this __attribute__((unused)))
|
||||
{
|
||||
mxml_node_t *tree, *b;
|
||||
int i = -1;
|
||||
int i;
|
||||
char *c;
|
||||
const char *cwmp_urn;
|
||||
|
||||
|
|
@ -880,7 +880,7 @@ int cwmp_handle_rpc_cpe_get_parameter_names(struct rpc *rpc)
|
|||
mxml_node_t *n;
|
||||
char *parameter_name = NULL;
|
||||
bool next_level = true;
|
||||
int counter = 0, fault_code = FAULT_CPE_INTERNAL_ERROR;
|
||||
int counter = 0, fault_code;
|
||||
char *err_msg = NULL;
|
||||
LIST_HEAD(parameters_list);
|
||||
|
||||
|
|
@ -1077,7 +1077,7 @@ int cwmp_handle_rpc_cpe_set_parameter_values(struct rpc *rpc)
|
|||
{
|
||||
mxml_node_t *b = NULL;
|
||||
char *parameter_key = NULL;
|
||||
int fault_code = FAULT_CPE_INTERNAL_ERROR, ret = 0;
|
||||
int fault_code, ret = 0;
|
||||
char *err_msg = NULL;
|
||||
|
||||
LIST_HEAD(xml_list_set_param_value);
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ void cwmp_start_upload(struct uloop_timeout *timeout)
|
|||
{
|
||||
struct upload *pupload;
|
||||
int error = FAULT_CPE_NO_FAULT;
|
||||
struct transfer_complete *ptransfer_complete;
|
||||
struct transfer_complete *ptransfer_complete = NULL;
|
||||
|
||||
pupload = container_of(timeout, struct upload, handler_timer);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue