瀏覽代碼

tracing/events: protect __get_str()

The __get_str() macro is used in a code part then its content should be
protected with parenthesis.

[ Impact: make macro definition more robust ]

Reported-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Frederic Weisbecker 16 年之前
父節點
當前提交
6a74aa4090
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      include/trace/ftrace.h

+ 1 - 1
include/trace/ftrace.h

@@ -123,7 +123,7 @@
 #define TP_printk(fmt, args...) fmt "\n", args
 #define TP_printk(fmt, args...) fmt "\n", args
 
 
 #undef __get_str
 #undef __get_str
-#define __get_str(field)	(char *)__entry + __entry->__str_loc_##field
+#define __get_str(field)	((char *)__entry + __entry->__str_loc_##field)
 
 
 #undef TRACE_EVENT
 #undef TRACE_EVENT
 #define TRACE_EVENT(call, proto, args, tstruct, assign, print)		\
 #define TRACE_EVENT(call, proto, args, tstruct, assign, print)		\