Upgrade to 4.4.50-rt62
[kvmfornfv.git] / kernel / kernel / trace / trace_printk.c
index 060df67..ad1d616 100644 (file)
@@ -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;
                }
 
@@ -296,6 +301,9 @@ static int t_show(struct seq_file *m, void *v)
        const char *str = *fmt;
        int i;
 
+       if (!*fmt)
+               return 0;
+
        seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);
 
        /*