From: Li Xiasong <lixiasong1@huawei.com> hulk inclusion category: feature bugzilla: https://atomgit.com/openeuler/kernel/issues/9102 -------------------------------- In mode 0, vecls_ntuple_res_init() may succeed before vecls_flow_res_init(). If flow init fails, ntuple resources are not released on the error path. Add a dedicated cleanup label and call vecls_ntuple_res_clean() before falling through the common teardown path, so init rollback is complete. Signed-off-by: Li Xiasong <lixiasong1@huawei.com> Signed-off-by: Yue Haibing <yuehaibing@huawei.com> --- net/venetcls/venetcls_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/net/venetcls/venetcls_main.c b/net/venetcls/venetcls_main.c index fefdbd7d552a..ab7808f6a955 100644 --- a/net/venetcls/venetcls_main.c +++ b/net/venetcls/venetcls_main.c @@ -1142,8 +1142,11 @@ static __init int vecls_init(void) err = vecls_ntuple_res_init(); if (err) goto clean_rxq; - if (lo_rps_policy || rps_policy) + if (lo_rps_policy || rps_policy) { err = vecls_flow_res_init(); + if (err) + goto clean_ntuple; + } } else { err = vecls_flow_res_init(); } @@ -1163,6 +1166,8 @@ static __init int vecls_init(void) return 0; +clean_ntuple: + vecls_ntuple_res_clean(); clean_rxq: clean_numa: clean_vecls_netdev_info(); -- 2.34.1