diff options
author | Shyam Saini <shyamsaini@linux.microsoft.com> | 2025-02-27 10:49:28 -0800 |
---|---|---|
committer | Petr Pavlu <petr.pavlu@suse.com> | 2025-04-16 14:54:35 +0200 |
commit | 1c7777feb0e2f5925908c489513656ebb443a699 (patch) | |
tree | 6c6d919281d4eacb84447da634e6211dd26e1fee /scripts/generate_rust_analyzer.py | |
parent | bbc9462f0cb0c8917a4908e856731708f0cee910 (diff) | |
download | linux-1c7777feb0e2f5925908c489513656ebb443a699.tar.gz linux-1c7777feb0e2f5925908c489513656ebb443a699.tar.bz2 linux-1c7777feb0e2f5925908c489513656ebb443a699.zip |
kernel: refactor lookup_or_create_module_kobject()
In the unlikely event of the allocation failing, it is better to let
the machine boot with a not fully populated sysfs than to kill it with
this BUG_ON(). All callers are already prepared for
lookup_or_create_module_kobject() returning NULL.
This is also preparation for calling this function from non __init
code, where using BUG_ON for allocation failure handling is not
acceptable.
Since we are here, also start using IS_ENABLED instead of #ifdef
construct.
Suggested-by: Thomas Weißschuh <linux@weissschuh.net>
Suggested-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Shyam Saini <shyamsaini@linux.microsoft.com>
Link: https://lore.kernel.org/r/20250227184930.34163-3-shyamsaini@linux.microsoft.com
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions