Skip to content

Commit 20a264c

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: cros_ec_proto: drop BUG_ON() in cros_ec_get_host_event()
It is overkill to crash the kernel if the `ec_dev` doesn't support MKBP event but gets called into cros_ec_get_host_event(). Drop the BUG_ON() and return error (0 in the case) instead. Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c2dcb1b commit 20a264c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,8 @@ u32 cros_ec_get_host_event(struct cros_ec_device *ec_dev)
817817
{
818818
u32 host_event;
819819

820-
BUG_ON(!ec_dev->mkbp_event_supported);
820+
if (!ec_dev->mkbp_event_supported)
821+
return 0;
821822

822823
if (ec_dev->event_data.event_type != EC_MKBP_EVENT_HOST_EVENT)
823824
return 0;

0 commit comments

Comments
 (0)