mirror of
https://github.com/schoebel/mars
synced 2024-12-26 08:32:24 +00:00
fixed memleak in trans_logger
This commit is contained in:
parent
91f262b72b
commit
fa6f0a6cf5
15
lib_log.c
15
lib_log.c
@ -6,6 +6,11 @@
|
||||
|
||||
#include "lib_log.h"
|
||||
|
||||
//#define BRICK_DEBUGGING
|
||||
//#define MARS_DEBUGGING
|
||||
//#define IO_DEBUGGING
|
||||
|
||||
|
||||
bool is_log_ready(struct log_status *logst)
|
||||
{
|
||||
return logst->max_flying <= 0 ||
|
||||
@ -22,6 +27,16 @@ void exit_logst(struct log_status *logst)
|
||||
MARS_DBG("waiting for IO terminating...");
|
||||
msleep(500);
|
||||
}
|
||||
if (logst->read_mref) {
|
||||
MARS_DBG("putting read_mref\n");
|
||||
GENERIC_INPUT_CALL(logst->input, mref_put, logst->read_mref);
|
||||
logst->read_mref = NULL;
|
||||
}
|
||||
if (logst->log_mref) {
|
||||
MARS_DBG("putting log_mref\n");
|
||||
GENERIC_INPUT_CALL(logst->input, mref_put, logst->log_mref);
|
||||
logst->log_mref = NULL;
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(exit_logst);
|
||||
|
||||
|
@ -1975,8 +1975,8 @@ void _exit_inputs(struct trans_logger_brick *brick, bool force)
|
||||
for (i = TL_INPUT_LOG1; i <= TL_INPUT_LOG2; i++) {
|
||||
struct trans_logger_input *input = brick->inputs[i];
|
||||
struct log_status *logst = &input->logst;
|
||||
if (input->is_operating &&
|
||||
(force || !input->connect)) {
|
||||
if (force ||
|
||||
(input->is_operating &&!input->connect)) {
|
||||
MARS_DBG("cleaning up input %d (log = %d old = %d)\n", i, brick->log_input_nr, brick->old_input_nr);
|
||||
exit_logst(logst);
|
||||
input->is_operating = false;
|
||||
|
Loading…
Reference in New Issue
Block a user