platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_prepare_tx()
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 13 May 2022 04:41:39 +0000 (12:41 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 16 May 2022 02:01:51 +0000 (10:01 +0800)
commitc2dcb1b06053a1ccfb73fe84e7b54b92383401cc
tree253e28cb483fe1b1977ddc27c5381a1728de3119
parent71d3ae7fb6404c87b498f8b7f86b8271dd74989f
platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_prepare_tx()

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-4-tzungbi@kernel.org
drivers/platform/chrome/cros_ec_proto.c