* [PATCH] kernel/module: improve documentation for try_module_get()
@ 2023-12-21 16:58 Marco Pagani
2023-12-21 18:26 ` Luis Chamberlain
0 siblings, 1 reply; 2+ messages in thread
From: Marco Pagani @ 2023-12-21 16:58 UTC (permalink / raw)
To: Luis Chamberlain; +Cc: Marco Pagani, linux-modules, linux-kernel
The sentence "this call will fail if the module is already being
removed" is potentially confusing and may contradict the rest of the
documentation. If one tries to get a module that has already been
removed using a stale pointer, the kernel will crash.
Signed-off-by: Marco Pagani <marpagan@redhat.com>
---
include/linux/module.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index a98e188cf37b..08364d5cbc07 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -668,7 +668,7 @@ extern void __module_get(struct module *module);
* @module: the module we should check for
*
* Only try to get a module reference count if the module is not being removed.
- * This call will fail if the module is already being removed.
+ * This call will fail if the module is in the process of being removed.
*
* Care must also be taken to ensure the module exists and is alive prior to
* usage of this call. This can be gauranteed through two means:
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kernel/module: improve documentation for try_module_get()
2023-12-21 16:58 [PATCH] kernel/module: improve documentation for try_module_get() Marco Pagani
@ 2023-12-21 18:26 ` Luis Chamberlain
0 siblings, 0 replies; 2+ messages in thread
From: Luis Chamberlain @ 2023-12-21 18:26 UTC (permalink / raw)
To: Marco Pagani; +Cc: linux-modules, linux-kernel
On Thu, Dec 21, 2023 at 05:58:47PM +0100, Marco Pagani wrote:
> The sentence "this call will fail if the module is already being
> removed" is potentially confusing and may contradict the rest of the
> documentation. If one tries to get a module that has already been
> removed using a stale pointer, the kernel will crash.
>
> Signed-off-by: Marco Pagani <marpagan@redhat.com>
Thanks, patch applied!
Luis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-12-21 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21 16:58 [PATCH] kernel/module: improve documentation for try_module_get() Marco Pagani
2023-12-21 18:26 ` Luis Chamberlain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox