platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c()
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 13 May 2022 04:41:41 +0000 (12:41 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 16 May 2022 02:01:51 +0000 (10:01 +0800)
commit8bff946c4199fd79f43dbff93c030b58b01bed65
treeaec1da05164a4cd61fd2e67975fe1a2f7d6345ab
parent20a264c97bc8c17d3a7dd7e8d0f72dc57b02c75e
platform/chrome: cros_ec_i2c: drop BUG_ON() in cros_ec_pkt_xfer_i2c()

It is overkill to crash the kernel if the given message is oversize.

Drop the BUG_ON() and return -EINVAL instead.

Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20220513044143.1045728-6-tzungbi@kernel.org
drivers/platform/chrome/cros_ec_i2c.c