From patchwork Fri Oct 14 21:37:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 13007350 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from pdx1-mailman-customer002.dreamhost.com (listserver-buz.dreamhost.com [69.163.136.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 73A29C433FE for ; Fri, 14 Oct 2022 21:38:32 +0000 (UTC) Received: from pdx1-mailman-customer002.dreamhost.com (localhost [127.0.0.1]) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTP id 4Mq0BH4XDvz21Gn; Fri, 14 Oct 2022 14:38:31 -0700 (PDT) Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pdx1-mailman-customer002.dreamhost.com (Postfix) with ESMTPS id 4Mq0B21CXTz1wc2 for ; Fri, 14 Oct 2022 14:38:18 -0700 (PDT) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id EBDB71006F28; Fri, 14 Oct 2022 17:38:13 -0400 (EDT) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id DEB47DD6C6; Fri, 14 Oct 2022 17:38:13 -0400 (EDT) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Fri, 14 Oct 2022 17:37:54 -0400 Message-Id: <1665783491-13827-4-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1665783491-13827-1-git-send-email-jsimmons@infradead.org> References: <1665783491-13827-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 03/20] lustre: obdclass: free inst_name correctly X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.39 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Emoly Liu 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 Reviewed-on: https://review.whamcloud.com/48542 Reviewed-by: Andreas Dilger Reviewed-by: Zhenyu Xu Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- fs/lustre/obdclass/obd_config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; }