From nobody Sat Nov 23 20:34:14 2024 Received: from cmccmta2.chinamobile.com (cmccmta8.chinamobile.com [111.22.67.151]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5B105149C4A for ; Mon, 11 Nov 2024 09:17:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=111.22.67.151 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731316635; cv=none; b=tiWXUu2ST5Kpr5YNAU5eYRNR3+ddPkZR0z7xjm/y72h1IpHBkDyvYsg+STUp4HrfMRFi8bm0Jxfnp0G+K1WK5xoL1+gqpyeHIGdraP1HfTetPHmWjCxXT4g8acRsqwmB0v7OCe0IGVhi21AhSC9DMK9/NA0P8l0VSLFBz3svtQg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731316635; c=relaxed/simple; bh=SsAUIRV4dI67TI/ZhJOFyUAXdCCfU6LycSKaXyT+mKk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WKVWE5oX1PDMs829j7dhBoLAFVCaE+SQEa5h6qF3cfzW8Wv2Parf9BATErT/mExtaA/lLXzVxnuxRkCBkWgyoxqCFRznhDC1a9Wz404c15vjBkE8HfGmhfxE4SIc8rhYoKxxEkNR9VZmi90yzd3W2LmA8WBKfkAFKNGlFBuQ/ng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com; spf=pass smtp.mailfrom=cmss.chinamobile.com; arc=none smtp.client-ip=111.22.67.151 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmss.chinamobile.com X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from spf.mail.chinamobile.com (unknown[10.188.0.87]) by rmmx-syy-dmz-app06-12006 (RichMail) with SMTP id 2ee66731cb8f228-d3af8; Mon, 11 Nov 2024 17:17:03 +0800 (CST) X-RM-TRANSID: 2ee66731cb8f228-d3af8 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.108.79.103]) by rmsmtp-syy-appsvr05-12005 (RichMail) with SMTP id 2ee56731cb8e9fa-217c4; Mon, 11 Nov 2024 17:17:03 +0800 (CST) X-RM-TRANSID: 2ee56731cb8e9fa-217c4 From: Luo Yifan To: jpoimboe@redhat.com, acme@kernel.org Cc: linux-kernel@vger.kernel.org, Luo Yifan Subject: [PATCH] tools/lib/subcmd: Move va_end before exit Date: Mon, 11 Nov 2024 17:17:01 +0800 Message-Id: <20241111091701.275496-1-luoyifan@cmss.chinamobile.com> X-Mailer: git-send-email 2.27.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This patch makes a minor adjustment by moving the va_end call before exit. Since the exit() function terminates the program, any code after exit(128) (i.e., va_end(params)) is unreachable and thus not executed. Placing va_end before exit ensures that the va_list is properly cleaned up. Signed-off-by: Luo Yifan --- tools/lib/subcmd/subcmd-util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lib/subcmd/subcmd-util.h b/tools/lib/subcmd/subcmd-util.h index dfac76e35..c742b0881 100644 --- a/tools/lib/subcmd/subcmd-util.h +++ b/tools/lib/subcmd/subcmd-util.h @@ -20,8 +20,8 @@ static __noreturn inline void die(const char *err, ...) =20 va_start(params, err); report(" Fatal: ", err, params); - exit(128); va_end(params); + exit(128); } =20 #define zfree(ptr) ({ free(*ptr); *ptr =3D NULL; }) --=20 2.27.0