i2c: core-smbus: don't trace smbus_reply data on errors
authorJohn Sperbeck <jsperbeck@google.com>
Wed, 13 Feb 2019 03:40:57 +0000 (19:40 -0800)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 14 Feb 2019 17:01:33 +0000 (18:01 +0100)
commitd8434c31378d5f2009741fa171bd1143c77a6e4a
treebe2b7be01c75f99e907407e3c31cf9c6f00ea743
parent237b5f66e1ed8a58662f29bcd04442953cdb8b55
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>
drivers/i2c/i2c-core-smbus.c
include/trace/events/smbus.h