diff mbox series

[03/20] lustre: obdclass: free inst_name correctly

Message ID 1665783491-13827-4-git-send-email-jsimmons@infradead.org (mailing list archive)
State New, archived
Headers show
Series lustre: backport OpenSFS work as of Oct 14, 2022 | expand

Commit Message

James Simmons Oct. 14, 2022, 9:37 p.m. UTC
From: Emoly Liu <emoly@whamcloud.com>

In functon class_config_llog_handler(), inst_name should be freed
correctly before break.

WC-bug-id: https://jira.whamcloud.com/browse/LU-16154
Lustre-commit: e7f17c5e0c95dba3b ("LU-16154 obdclass: free inst_name correctly")
Signed-off-by: Emoly Liu <emoly@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/48542
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Zhenyu Xu <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/obdclass/obd_config.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/lustre/obdclass/obd_config.c b/fs/lustre/obdclass/obd_config.c
index 7d001ffaf121..2b24276880a6 100644
--- a/fs/lustre/obdclass/obd_config.c
+++ b/fs/lustre/obdclass/obd_config.c
@@ -1230,7 +1230,7 @@  int class_config_llog_handler(const struct lu_env *env,
 			       clli->cfg_flags);
 			rc = 0;
 			/* No processing! */
-			break;
+			goto out_inst;
 		}
 
 		/*
@@ -1352,7 +1352,7 @@  int class_config_llog_handler(const struct lu_env *env,
 		lcfg_new = kzalloc(lcfg_len, GFP_NOFS);
 		if (!lcfg_new) {
 			rc = -ENOMEM;
-			goto out;
+			goto out_inst;
 		}
 
 		lustre_cfg_init(lcfg_new, lcfg->lcfg_command, &bufs);
@@ -1379,6 +1379,7 @@  int class_config_llog_handler(const struct lu_env *env,
 
 		rc = class_process_config(lcfg_new);
 		kfree(lcfg_new);
+out_inst:
 		kfree(inst_name);
 		break;
 	}