]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
klp-build: Validate patch file existence
authorJosh Poimboeuf <jpoimboe@kernel.org>
Fri, 3 Apr 2026 02:48:45 +0000 (19:48 -0700)
committerJosh Poimboeuf <jpoimboe@kernel.org>
Tue, 5 May 2026 04:16:03 +0000 (21:16 -0700)
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

index 68d61b72f39a9bb341fa7749381cbb90b452cb00..13709d20e295c6c3e075e83b435d53b2aa9f1b02 100755 (executable)
@@ -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