Re: [PATCH 5/5] module/dups: Clean up includes
From: sashiko-bot@kernel.org
Date: 2026-07-20 12:32:44
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Low] The function `kmod_dup_request_exists_wait()` mixes `goto`-based error/cleanup handling with `scoped_guard()` declarations, violating subsystem guidelines. --
--- Patch [5]: [PATCH 5/5] module/dups: Clean up includes ---commit 94d1ce7350f8ea78793315796cdc680daf4e1298 Author: Petr Pavlu [off-list ref] module/dups: Clean up includes This patch cleans up the #include directives in kernel/module/dups.c. It explicitly includes the headers for all definitions and functions relied upon by the file.
quoted hunk ↗ jump to hunk
diff --git a/kernel/module/dups.c b/kernel/module/dups.c index 43cec4cec4fdb..76faa662f14d8 100644 --- a/kernel/module/dups.c +++ b/kernel/module/dups.c@@ -7,30 +7,22 @@ #define pr_fmt(fmt) "module: " fmt +#include <linux/bug.h> +#include <linux/cleanup.h>
[Severity: Low]
Does kmod_dup_request_exists_wait() violate the cleanup subsystem guidelines
by mixing goto labels and scoped_guard() declarations?
kernel/module/dups.c:kmod_dup_request_exists_wait() {
...
scoped_guard(mutex, &kmod_dup_mutex) {
kmod_req = kmod_dup_request_lookup(module_name);
if (kmod_req) {
get_kmod_req(kmod_req);
goto dup_req;
}
...
}
...
dup_req:
...
if (!wait) {
...
goto out;
}
...
out:
put_kmod_req(kmod_req);
return true;
}
The cleanup subsystem guidelines expect that usage of goto and cleanup
helpers are never mixed in the same function.
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260720121621.750661-1-petr.pavlu@suse.com?part=5