platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 13 May 2022 04:41:43 +0000 (12:41 +0800)
committerTzung-Bi Shih <tzungbi@kernel.org>
Mon, 16 May 2022 02:01:52 +0000 (10:01 +0800)
commitbbd43a37ec7a02e81dc0afb2c6194957518a904b
tree1fe3b8d3c0e3c09a866c60944304759ef8262397
parentddec8e9e90cea8e8430b04a01adce7fb196d95c6
platform/chrome: cros_ec_spi: drop BUG_ON() if `din` isn't large enough

It is overkill to crash the kernel if the `din` buffer is going to full
or overflow.

Drop the BUG_ON() and return -EINVAL instead.

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