From 4748db6ffd422f8b52d49f5e2982628ac52afb8c Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Sun, 7 Jan 2024 09:50:51 -0700 Subject: [PATCH] checkstyle9.pl: Don't use $root if not defined $root is only defined when given on the command line. Don't try to use its value when it's not defined. Sponsored by: Netflix --- tools/build/checkstyle9.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build/checkstyle9.pl b/tools/build/checkstyle9.pl index d2c6ea77868d..3b28fef93669 100755 --- a/tools/build/checkstyle9.pl +++ b/tools/build/checkstyle9.pl @@ -1410,7 +1410,7 @@ sub process { checkfilename($realfile, \$acpi_testexpected, \$acpi_nontestexpected); $p1_prefix = $1; - if (!$file && $tree && $p1_prefix ne '' && + if (!$file && $tree && $p1_prefix ne '' && defined $root && -e "$root/$p1_prefix") { WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); }