mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 09:28:44 -04:00
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: d8ce30e0cf ("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>
This commit is contained in:
committed by
David S. Miller
parent
b498ee3f76
commit
140960564d
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user