提交 14096056 编写于 作者: W Wei Yongjun 提交者: David S. Miller

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: d8ce30e0 ("octeontx2-pf: add tc flower stats handler for hw offloads")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b498ee3f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册