Skip to content

Commit 27565cf

Browse files
mchehabJonathan Corbet
authored andcommitted
scripts: kernel-doc: prevent a KeyError when checking output
If a file sent to KernelFiles.msg() method doesn't exist, instead of producing a KeyError, output an error message. Reported-by: Randy Dunlap <[email protected]> Closes: https://lore.kernel.org/linux-doc/[email protected]/T/#ma43ae9d8d0995b535cf5099e5381dace0410de04 Signed-off-by: Mauro Carvalho Chehab <[email protected]> Acked-by: Akira Yokosawa <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Message-ID: <4efa177f2157a7ec009cc197dfc2d87e6f32b165.1747817887.git.mchehab+huawei@kernel.org>
1 parent 2f3f7ba commit 27565cf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/lib/kdoc/kdoc_files.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ def msg(self, enable_lineno=False, export=False, internal=False,
271271
no_doc_sections)
272272

273273
msg = ""
274+
if fname not in self.results:
275+
self.config.log.warning("No kernel-doc for file %s", fname)
276+
continue
277+
274278
for name, arg in self.results[fname]:
275279
m = self.out_msg(fname, name, arg)
276280

0 commit comments

Comments
 (0)