[lttng-dev] [PATCH] Check if interrupt action name is not null in statedump.

Simon Marchi simon.marchi at polymtl.ca
Thu Nov 8 15:17:18 EST 2012


Protection against poorly written drivers who give a null name to their
irq handlers.

Signed-off-by: Simon Marchi <simon.marchi at polymtl.ca>
---
 .../events/lttng-module/lttng-statedump.h          |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/instrumentation/events/lttng-module/lttng-statedump.h b/instrumentation/events/lttng-module/lttng-statedump.h
index d350cad..e4c86d6 100644
--- a/instrumentation/events/lttng-module/lttng-statedump.h
+++ b/instrumentation/events/lttng-module/lttng-statedump.h
@@ -150,12 +150,12 @@ TRACE_EVENT(lttng_statedump_interrupt,
 	TP_STRUCT__entry(
 		__field(unsigned int, irq)
 		__string(name, chip_name)
-		__string(action, action->name)
+		__string(action, action->name ? : "")
 	),
 	TP_fast_assign(
 		tp_assign(irq, irq)
 		tp_strcpy(name, chip_name)
-		tp_strcpy(action, action->name)
+		tp_strcpy(action, action->name ? : "")
 	),
 	TP_printk("")
 )
-- 
1.7.1




More information about the lttng-dev mailing list