|
@@ -36,6 +36,10 @@ struct trace_bprintk_fmt {
|
|
|
static inline struct trace_bprintk_fmt *lookup_format(const char *fmt)
|
|
|
{
|
|
|
struct trace_bprintk_fmt *pos;
|
|
|
+
|
|
|
+ if (!fmt)
|
|
|
+ return ERR_PTR(-EINVAL);
|
|
|
+
|
|
|
list_for_each_entry(pos, &trace_bprintk_fmt_list, list) {
|
|
|
if (!strcmp(pos->fmt, fmt))
|
|
|
return pos;
|
|
@@ -57,7 +61,8 @@ void hold_module_trace_bprintk_format(const char **start, const char **end)
|
|
|
for (iter = start; iter < end; iter++) {
|
|
|
struct trace_bprintk_fmt *tb_fmt = lookup_format(*iter);
|
|
|
if (tb_fmt) {
|
|
|
- *iter = tb_fmt->fmt;
|
|
|
+ if (!IS_ERR(tb_fmt))
|
|
|
+ *iter = tb_fmt->fmt;
|
|
|
continue;
|
|
|
}
|
|
|
|