函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_kmod.c Create Date:2022-07-27 07:32:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alloc_test_dev_kmod

函数原型:static struct kmod_test_device *alloc_test_dev_kmod(int idx)

返回类型:struct kmod_test_device

参数:

类型参数名称
intidx
1086  test_dev等于vzalloc(sizeof(structkmod_test_device))
1087  如果非test_dev则转到:err_out
1090  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & config_mutex)
1091  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & trigger_mutex)
1092  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & thread_mutex)
1094  init_completion( & kthreads_done)
1096  ret等于kmod_config_init(test_dev)
1097  如果ret小于0则
1098  打印错误信息("Cannot alloc kmod_config_init()\n")
1099  转到:err_out_free
1102  dev_idx等于idx
1103  misc_dev等于misc_dev
1105  minor等于MISC_DYNAMIC_MINOR
1106  name等于kasprintf(GFP_KERNEL, "test_kmod%d", idx)
1107  如果非name
1108  打印错误信息("Cannot alloc misc_dev->name\n")
1109  转到:err_out_free_config
1111  groups等于test_dev_groups
1113  返回:test_dev
1115  err_out_free_config :
1116  free_test_dev_info(test_dev)
1117  kmod_config_free(test_dev)
1118  err_out_free :
1119  vfree(test_dev)
1120  test_dev = NULL
1121  err_out :
1122  返回:NULL
调用者
名称描述
register_test_dev_kmod