Hi Maintainer, I have update the patch base on your feedback, please help review again. V3: -Fix initial value; -Remove unnecessary checks about mod->sects_attrs -Check sysfs_creat_* return value as error code -Reorder the reveral of successful operations before exiting We will use the information recorded in mod->sects_attrs for debugging. When a panic occurs in a .ko, we can use gdb to load the symbols of the .ko file along with the coredump, and use the text segment address and init.text segment address in mod->sects_attrs to debug. If there is an error in add_sysfs_setup and the .ko is still loaded and runs normally, when the ko suffer panic later, we would not be able to access the loading addresses of the ko, which would prevent us from being able to debug effectively. Therefore, it is desired that if there is an error during load module, it should prevent the ko from being inserted with insmod. This ensures that as long as the .ko is successfully loaded, all necessary information for debugging is available. Thanks for your time. Chunhui Li (1): module: abort module loading when sysfs setup suffer errors kernel/module/sysfs.c | 57 +++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 21 deletions(-) -- 2.45.2