diff --git a/kerneldriver/core/analyze_unit/secDetector_save_check.c b/kerneldriver/core/analyze_unit/secDetector_save_check.c index 0ab40ce20bf948cc961242c3fca6a5a197db5675..4a5f6891a190a399abf41814831f961c0b314248 100644 --- a/kerneldriver/core/analyze_unit/secDetector_save_check.c +++ b/kerneldriver/core/analyze_unit/secDetector_save_check.c @@ -124,7 +124,7 @@ static int analyze_save_check_normal(struct list_head *collect_data_list, analyz break; } if (measure_value != analyze_status_data->sc_data.data[data_index]) { - pr_debug("[save_check]%s: original: %lld; now: %lld.!\n", + pr_warn("[save_check]%s: original: %llu; now: %llu.!\n", cd->name, analyze_status_data->sc_data.data[data_index], measure_value); response_arrays[response_array_index] = kzalloc(strlen(cd->name) + REPORT_MORE_CHAR_LEN, GFP_KERNEL); if (response_arrays[response_array_index] == NULL) { @@ -136,13 +136,13 @@ static int analyze_save_check_normal(struct list_head *collect_data_list, analyz strcpy(response_arrays[response_array_index], " secswitch_name="); //应该有 workflow的名字 strncat(response_arrays[response_array_index], cd->name, strlen(cd->name)); - strcat(response_arrays[response_array_index]," old_value="); - sprintf(int_str, "%lld", analyze_status_data->sc_data.data[data_index]); + strcat(response_arrays[response_array_index], " old_value="); + sprintf(int_str, "%llu", analyze_status_data->sc_data.data[data_index]); strncat(response_arrays[response_array_index], int_str, strlen(int_str)); - strcat(response_arrays[response_array_index]," new_value="); - sprintf(int_str, "%lld", measure_value); + strcat(response_arrays[response_array_index], " new_value="); + sprintf(int_str, "%llu", measure_value); strncat(response_arrays[response_array_index], int_str, strlen(int_str)); - strcat(response_arrays[response_array_index],".\n"); + strcat(response_arrays[response_array_index], "."); response_data_char_len += strlen(response_arrays[response_array_index]); ret = RESPONSE_REPORT; @@ -168,6 +168,7 @@ static int analyze_save_check_normal(struct list_head *collect_data_list, analyz } for (i = 0; i < response_array_index; i++) strncat(response_data->report_data.text, response_arrays[i], strlen(response_arrays[i])); + strcat(response_data->report_data.text, "\n"); } end: for (i = 0; i < response_array_index; i++) diff --git a/kerneldriver/core/collect_unit/secDetector_collect.c b/kerneldriver/core/collect_unit/secDetector_collect.c index c04dd33888af9b12cdfdc96bed28d998c1624ba6..22405775e7c98702b55a492169d57a8a543329a1 100644 --- a/kerneldriver/core/collect_unit/secDetector_collect.c +++ b/kerneldriver/core/collect_unit/secDetector_collect.c @@ -32,6 +32,7 @@ struct collect_data *init_collect_data(const char *name) cd->name = kmalloc(nl + 1, GFP_KERNEL); if (cd->name == NULL) { pr_err("kmalloc failed"); + kfree(cd); return NULL; } strncpy(cd->name, name, nl);