Skip to content

Commit c91a7de

Browse files
committed
Merge tag 'chrome-platform-fixes-for-v6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
Pull chrome-platform fix from Tzung-Bi Shih: "Fix a race condition that sends multiple host commands at a time" * tag 'chrome-platform-fixes-for-v6.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: cros_ec_proto: Lock device when updating MKBP version
2 parents 22f5468 + df61590 commit c91a7de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/platform/chrome/cros_ec_proto.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,9 +813,11 @@ int cros_ec_get_next_event(struct cros_ec_device *ec_dev,
813813
if (ret == -ENOPROTOOPT) {
814814
dev_dbg(ec_dev->dev,
815815
"GET_NEXT_EVENT returned invalid version error.\n");
816+
mutex_lock(&ec_dev->lock);
816817
ret = cros_ec_get_host_command_version_mask(ec_dev,
817818
EC_CMD_GET_NEXT_EVENT,
818819
&ver_mask);
820+
mutex_unlock(&ec_dev->lock);
819821
if (ret < 0 || ver_mask == 0)
820822
/*
821823
* Do not change the MKBP supported version if we can't

0 commit comments

Comments
 (0)