From: Emoly Liu Date: Thu, 15 Sep 2022 01:42:47 +0000 (+0800) Subject: LU-16154 obdclass: free inst_name correctly X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=f60c43c6da3ff5dcb5b1317bd5f440cd549bc961;p=fs%2Flustre-release.git LU-16154 obdclass: free inst_name correctly In functon class_config_llog_handler(), inst_name should be freed correctly before break. Lustre-change: https://review.whamcloud.com/48542 Lustre-commit: e7f17c5e0c95dba3b80e192e4ca3628cc42e64b9 Signed-off-by: Emoly Liu Change-Id: I6adc0ed62c3c637237834b799f25666d0e7e1ecb Reviewed-on: https://review.whamcloud.com/48670 Tested-by: jenkins Reviewed-by: Andreas Dilger --- diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index de041ce..df79e4f 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -2004,16 +2004,15 @@ int class_config_llog_handler(const struct lu_env *env, libcfs_str2net(lsi->lsi_lmd->lmd_nidnet)) { CDEBUG(D_CONFIG, "skipping add_conn for %s\n", uuid_str); - rc = 0; /* No processing! */ - break; + GOTO(out_inst, rc = 0); } } OBD_ALLOC(lcfg_new, lustre_cfg_len(bufs.lcfg_bufcount, bufs.lcfg_buflen)); if (!lcfg_new) - GOTO(out, rc = -ENOMEM); + GOTO(out_inst, rc = -ENOMEM); lustre_cfg_init(lcfg_new, lcfg->lcfg_command, &bufs); lcfg_new->lcfg_num = lcfg->lcfg_num; @@ -2041,6 +2040,7 @@ int class_config_llog_handler(const struct lu_env *env, rc = class_process_config(lcfg_new); OBD_FREE(lcfg_new, lustre_cfg_len(lcfg_new->lcfg_bufcount, lcfg_new->lcfg_buflens)); +out_inst: if (inst_name) OBD_FREE(inst_name, inst_len); break;