Commit 7944672d authored by Junxian Huang's avatar Junxian Huang Committed by openeuler-sync-bot
Browse files

RDMA/hns: Fix a memory leak error when bond clear failed

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7WHE3



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

During bond clear, the slaves will be re-init to normal RDMA devices.
If the re-init failed, the current bond clear work returns directly
without removing bond id and kfree bond group, leading to a memory leak.

This patch adds a bus_num fields in 'struct hns_roce_bond_group' so that
the bond id removal no longer depends on 'bond_grp->main_hr_dev', and
the memory can still be released safely even if the main_hr_dev re-init
failed.

Fixes: e62a2027 ("RDMA/hns: support RoCE bonding")
Signed-off-by: default avatarJunxian Huang <huangjunxian6@hisilicon.com>
(cherry picked from commit ff235b9c)
parent ba12f460
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment