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:Junxian Huang <huangjunxian6@hisilicon.com>
Loading
Please sign in to comment