aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-10-24 14:21:08 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-10-25 07:56:49 +0000
commita316ebdbff3a501a1b041a488b2f22c8783df5f8 (patch)
tree410e1ea663659c3367479aaab39e524ed1050214 /tools
parentba18b40ca3ec5a7fcbd9a0abed1d54e33b36b720 (diff)
tools/syz-declextract: fix error handling
Fix the following bugs: if fErr != nil { tool.Fail(err) }
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-declextract/run.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/syz-declextract/run.go b/tools/syz-declextract/run.go
index 36f1762d4..a680ea12c 100644
--- a/tools/syz-declextract/run.go
+++ b/tools/syz-declextract/run.go
@@ -303,18 +303,21 @@ func readSyscallNames(kernelDir string) map[string][]string {
for _, arch := range targets.List[targets.Linux] {
filepath.Walk(filepath.Join(kernelDir, arch.KernelHeaderArch),
func(path string, info fs.FileInfo, err error) error {
+ if err != nil {
+ return err
+ }
if !strings.HasSuffix(path, ".tbl") {
return nil
}
- fi, fErr := os.Lstat(path)
- if fErr != nil {
+ fi, err := os.Lstat(path)
+ if err != nil {
tool.Fail(err)
}
if fi.Mode()&fs.ModeSymlink != 0 { // Some symlinks link to files outside of arch directory.
return nil
}
- f, fErr := os.Open(path)
- if fErr != nil {
+ f, err := os.Open(path)
+ if err != nil {
tool.Fail(err)
}
s := bufio.NewScanner(f)