提交 d8a7322f 编写于 作者: S Sukadev Bhattiprolu 提交者: Zheng Zengkai

ibmvnic: free reset-work-item when flushing

stable inclusion
from stable-v5.10.104
commit 6acbc8875282d3ca8a73fa93cd7a9b166de5019c
bugzilla: https://gitee.com/openeuler/kernel/issues/I56XAC

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=6acbc8875282d3ca8a73fa93cd7a9b166de5019c

--------------------------------

commit 8d0657f3 upstream.

Fix a tiny memory leak when flushing the reset work queue.

Fixes: 2770a798 ("ibmvnic: Introduce hard reset recovery")
Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8ec27b48
...@@ -2354,8 +2354,10 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter, ...@@ -2354,8 +2354,10 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
* flush reset queue and process this reset * flush reset queue and process this reset
*/ */
if (adapter->force_reset_recovery && !list_empty(&adapter->rwi_list)) { if (adapter->force_reset_recovery && !list_empty(&adapter->rwi_list)) {
list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) {
list_del(entry); list_del(entry);
kfree(list_entry(entry, struct ibmvnic_rwi, list));
}
} }
rwi->reset_reason = reason; rwi->reset_reason = reason;
list_add_tail(&rwi->list, &adapter->rwi_list); list_add_tail(&rwi->list, &adapter->rwi_list);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册