|
@@ -59,18 +59,19 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ fmt = NULL;
|
|
tb_fmt = kmalloc(sizeof(*tb_fmt), GFP_KERNEL);
|
|
tb_fmt = kmalloc(sizeof(*tb_fmt), GFP_KERNEL);
|
|
- if (tb_fmt)
|
|
|
|
|
|
+ if (tb_fmt) {
|
|
fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL);
|
|
fmt = kmalloc(strlen(*iter) + 1, GFP_KERNEL);
|
|
- if (tb_fmt && fmt) {
|
|
|
|
- list_add_tail(&tb_fmt->list, &trace_bprintk_fmt_list);
|
|
|
|
- strcpy(fmt, *iter);
|
|
|
|
- tb_fmt->fmt = fmt;
|
|
|
|
- *iter = tb_fmt->fmt;
|
|
|
|
- } else {
|
|
|
|
- kfree(tb_fmt);
|
|
|
|
- *iter = NULL;
|
|
|
|
|
|
+ if (fmt) {
|
|
|
|
+ list_add_tail(&tb_fmt->list, &trace_bprintk_fmt_list);
|
|
|
|
+ strcpy(fmt, *iter);
|
|
|
|
+ tb_fmt->fmt = fmt;
|
|
|
|
+ } else
|
|
|
|
+ kfree(tb_fmt);
|
|
}
|
|
}
|
|
|
|
+ *iter = fmt;
|
|
|
|
+
|
|
}
|
|
}
|
|
mutex_unlock(&btrace_mutex);
|
|
mutex_unlock(&btrace_mutex);
|
|
}
|
|
}
|