summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c
diff options
context:
space:
mode:
authorSteen Hegelund <steen.hegelund@microchip.com>2023-01-17 09:55:44 +0100
committerDavid S. Miller <davem@davemloft.net>2023-01-18 14:31:43 +0000
commit595655e081746f6fca8263154fd6fb5f2b22da24 (patch)
treee8cea0aeb82461f18517627ee96ac4f074c7a86d /drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c
parent1972b6d927ac326fd3a01240c330401f47526558 (diff)
net: microchip: sparx5: Add lock initialization to the KUNIT tests
Ensure that the KUNIT tests lock instance is initialized before the test is executed. Signed-off-by: Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c')
-rw-r--r--drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c
index 9211cb453a3d..cbf7e0f110b8 100644
--- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c
+++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c
@@ -246,6 +246,7 @@ static void vcap_test_api_init(struct vcap_admin *admin)
INIT_LIST_HEAD(&admin->list);
INIT_LIST_HEAD(&admin->rules);
INIT_LIST_HEAD(&admin->enabled);
+ mutex_init(&admin->lock);
list_add_tail(&admin->list, &test_vctrl.list);
memset(test_updateaddr, 0, sizeof(test_updateaddr));
test_updateaddridx = 0;