]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scripts: kernel-doc: prevent a KeyError when checking output
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 21 May 2025 09:02:15 +0000 (11:02 +0200)
committerJonathan Corbet <corbet@lwn.net>
Wed, 21 May 2025 09:53:40 +0000 (03:53 -0600)
If a file sent to KernelFiles.msg() method doesn't exist, instead
of producing a KeyError, output an error message.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Closes: https://lore.kernel.org/linux-doc/cover.1747719873.git.mchehab+huawei@kernel.org/T/#ma43ae9d8d0995b535cf5099e5381dace0410de04
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Acked-by: Akira Yokosawa <akiyks@gmail.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <4efa177f2157a7ec009cc197dfc2d87e6f32b165.1747817887.git.mchehab+huawei@kernel.org>

scripts/lib/kdoc/kdoc_files.py

index 630aa5ca6460e0a03b29812151903452946766bf..9be4a64df71de72572ab107c682eed37443cfd45 100644 (file)
@@ -271,6 +271,10 @@ class KernelFiles():
                                       no_doc_sections)
 
             msg = ""
+            if fname not in self.results:
+                self.config.log.warning("No kernel-doc for file %s", fname)
+                continue
+
             for name, arg in self.results[fname]:
                 m = self.out_msg(fname, name, arg)