Skip to content

Commit e410b4a

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: kunit: initialize lock for fake ec_dev
cros_ec_cmd_xfer() uses ec_dev->lock. Initialize it. Otherwise, dmesg shows the following: > DEBUG_LOCKS_WARN_ON(lock->magic != lock) > ... > Call Trace: > ? __mutex_lock > ? __warn > ? __mutex_lock > ... > ? cros_ec_cmd_xfer Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent a7bad16 commit e410b4a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/platform/chrome/cros_ec_proto_test.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2668,6 +2668,7 @@ static int cros_ec_proto_test_init(struct kunit *test)
26682668
ec_dev->dev->release = cros_ec_proto_test_release;
26692669
ec_dev->cmd_xfer = cros_kunit_ec_xfer_mock;
26702670
ec_dev->pkt_xfer = cros_kunit_ec_xfer_mock;
2671+
mutex_init(&ec_dev->lock);
26712672

26722673
priv->msg = (struct cros_ec_command *)priv->_msg;
26732674

0 commit comments

Comments
 (0)