Hash table should be freed correctly if failed to start a nrs policy,
otherwise it will cause memory leak.
Signed-off-by: Li Xi <lixi@ddn.com>
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: Ib5380fab1843af129f4cbf7ac396fb620bb8a617
Reviewed-on: https://review.whamcloud.com/17224
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
start.tc_name = NRS_TBF_DEFAULT_RULE;
INIT_LIST_HEAD(&start.u.tc_start.ts_jobids);
rc = nrs_tbf_rule_start(policy, head, &start);
+ if (rc) {
+ cfs_hash_putref(head->th_cli_hash);
+ head->th_cli_hash = NULL;
+ }
return rc;
}
start.tc_name = NRS_TBF_DEFAULT_RULE;
INIT_LIST_HEAD(&start.u.tc_start.ts_nids);
rc = nrs_tbf_rule_start(policy, head, &start);
+ if (rc) {
+ cfs_hash_putref(head->th_cli_hash);
+ head->th_cli_hash = NULL;
+ }
return rc;
}