Home
last modified time | relevance | path

Searched hist:"2 ae3c610e7d21bc4a27da2b71f7007f2c4efce01" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/platform/chrome/
H A Dcros_ec_lpc.cdiff 2ae3c610e7d21bc4a27da2b71f7007f2c4efce01 Tue Jan 10 13:36:11 CST 2023 Tom Rix <trix@redhat.com> platform/chrome: cros_ec_lpc: initialize the buf variable

Clang static analysis reports this problem
drivers/platform/chrome/cros_ec_lpc.c:379:13: warning: The left operand
of '!=' is a garbage value [core.UndefinedBinaryOperatorResult]
if (buf[0] != 'E' || buf[1] != 'C') {
~~~~~~ ^

The check depends on the side effect of the read. When the read fails
or is short, a buf containing garbage could be mistaken as correct.

Signed-off-by: Tom Rix <trix@redhat.com>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20230110193611.3573777-1-trix@redhat.com