diff options
author | John Sperbeck <jsperbeck@google.com> | 2019-02-13 06:40:57 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-02-14 20:01:33 +0300 |
commit | d8434c31378d5f2009741fa171bd1143c77a6e4a (patch) | |
tree | be2b7be01c75f99e907407e3c31cf9c6f00ea743 /drivers/i2c/i2c-core-smbus.c | |
parent | 237b5f66e1ed8a58662f29bcd04442953cdb8b55 (diff) | |
download | linux-d8434c31378d5f2009741fa171bd1143c77a6e4a.tar.xz |
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 'drivers/i2c/i2c-core-smbus.c')
-rw-r--r-- | drivers/i2c/i2c-core-smbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-smbus.c b/drivers/i2c/i2c-core-smbus.c index 9cd66cabb84f..132119112596 100644 --- a/drivers/i2c/i2c-core-smbus.c +++ b/drivers/i2c/i2c-core-smbus.c @@ -585,7 +585,7 @@ s32 __i2c_smbus_xfer(struct i2c_adapter *adapter, u16 addr, trace: /* If enabled, the reply tracepoint is conditional on read_write. */ trace_smbus_reply(adapter, addr, flags, read_write, - command, protocol, data); + command, protocol, data, res); trace_smbus_result(adapter, addr, flags, read_write, command, protocol, res); |