diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2021-03-19 09:41:03 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-19 12:09:22 -0700 |
commit | 140960564d6376fe6b702574a64434a7bc8f085c (patch) | |
tree | d11792bb65207ee8912bade7a6a03a962eaa8677 /drivers/net/ethernet | |
parent | b498ee3f7613f5ed1deac40451486274fc93fe30 (diff) |
octeontx2-pf: Fix missing spin_lock_init() in otx2_tc_add_flow()
The driver allocates the spinlock but not initialize it.
Use spin_lock_init() on it to initialize it correctly.
Fixes: d8ce30e0cf76 ("octeontx2-pf: add tc flower stats handler for hw offloads")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c index 2f75cfc5a23a..e919140d8965 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c @@ -536,6 +536,7 @@ static int otx2_tc_add_flow(struct otx2_nic *nic, new_node = kzalloc(sizeof(*new_node), GFP_KERNEL); if (!new_node) return -ENOMEM; + spin_lock_init(&new_node->lock); new_node->cookie = tc_flow_cmd->cookie; mutex_lock(&nic->mbox.lock); |