summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorJohn Sperbeck <jsperbeck@google.com>2019-02-12 19:40:57 -0800
committerWolfram Sang <wsa@the-dreams.de>2019-02-14 18:01:33 +0100
commitd8434c31378d5f2009741fa171bd1143c77a6e4a (patch)
treebe2b7be01c75f99e907407e3c31cf9c6f00ea743 /include/trace
parent237b5f66e1ed8a58662f29bcd04442953cdb8b55 (diff)
downloadlinux-d8434c31378d5f2009741fa171bd1143c77a6e4a.tar.bz2
i2c: core-smbus: don't trace smbus_reply data on errors
If an smbus transfer fails, there's no guarantee that the output buffer was written. So, avoid trying to show the output buffer when tracing after an error. This was 'mostly harmless', but would trip up kasan checking if left-over cruft in byte 0 is a large length, causing us to read from unwritten memory. Signed-off-by: John Sperbeck <jsperbeck@google.com> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/smbus.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/trace/events/smbus.h b/include/trace/events/smbus.h
index d2fb6e1d3e10..a4892a187842 100644
--- a/include/trace/events/smbus.h
+++ b/include/trace/events/smbus.h
@@ -138,9 +138,9 @@ TRACE_EVENT_CONDITION(smbus_reply,
TP_PROTO(const struct i2c_adapter *adap,
u16 addr, unsigned short flags,
char read_write, u8 command, int protocol,
- const union i2c_smbus_data *data),
- TP_ARGS(adap, addr, flags, read_write, command, protocol, data),
- TP_CONDITION(read_write == I2C_SMBUS_READ),
+ const union i2c_smbus_data *data, int res),
+ TP_ARGS(adap, addr, flags, read_write, command, protocol, data, res),
+ TP_CONDITION(res >= 0 && read_write == I2C_SMBUS_READ),
TP_STRUCT__entry(
__field(int, adapter_nr )
__field(__u16, addr )