[tip: objtool/core] klp-build: Validate patch file existence

tip-bot2 for Josh Poimboeuf posted 1 patch 1 month, 1 week ago
scripts/livepatch/klp-build | 5 +++++
1 file changed, 5 insertions(+)
[tip: objtool/core] klp-build: Validate patch file existence
Posted by tip-bot2 for Josh Poimboeuf 1 month, 1 week ago
The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     b3ece3019e8ebcda5e8451580e34bfbc97ef33e3
Gitweb:        https://git.kernel.org/tip/b3ece3019e8ebcda5e8451580e34bfbc97ef33e3
Author:        Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate:    Thu, 02 Apr 2026 19:48:45 -07:00
Committer:     Josh Poimboeuf <jpoimboe@kernel.org>
CommitterDate: Mon, 04 May 2026 21:16:03 -07:00

klp-build: Validate patch file existence

Make sure all patch files actually exist.  Otherwise there can be
confusing errors later.

Acked-by: Song Liu <song@kernel.org>
Reviewed-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
 scripts/livepatch/klp-build | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/livepatch/klp-build b/scripts/livepatch/klp-build
index 68d61b7..13709d2 100755
--- a/scripts/livepatch/klp-build
+++ b/scripts/livepatch/klp-build
@@ -157,6 +157,7 @@ process_args() {
 	local short
 	local long
 	local args
+	local patch
 
 	short="hfj:o:vdS:T"
 	long="help,show-first-changed,jobs:,output:,no-replace,verbose,debug,short-circuit:,keep-tmp"
@@ -235,6 +236,10 @@ process_args() {
 
 	KEEP_TMP="$keep_tmp"
 	PATCHES=("$@")
+
+	for patch in "${PATCHES[@]}"; do
+		[[ -f "$patch" ]] || die "$patch doesn't exist"
+	done
 }
 
 # temporarily disable xtrace for especially verbose code