函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:test_memcat_p_init

函数原型:static int __init test_memcat_p_init(void)

返回类型:int

参数:

25  err等于负ENOMEM, total等于0
27  in0等于分配数组内存并置零
28  如果非in0则返回:err
31  in1等于分配数组内存并置零
32  如果非in1则转到:err_free_in0
35 i小于Size of each of the NULL-terminated input arrays 减1循环
36  in0[i]等于kmalloc(in0的长度, GFP_KERNEL)
37  如果非in0[i]则转到:err_free_elements
40  in1[i]等于kmalloc(in1的长度, GFP_KERNEL)
41  如果非in1[i]则
42  kfree(in0[i])
43  转到:err_free_elements
47  r等于r乘725861取模6599
48  num等于r
49  num等于负r
50  magic等于MAGIC
51  magic等于MAGIC
54  in0[i] = in1[i] = NULL
56  out等于memcat_p(in0, in1)
57  如果非out则转到:err_free_all_elements
60  err等于负EINVAL
61 pi小于Size of each of the NULL-terminated input arrays 乘2减1循环
62  total加等于num
64  如果magic不等于MAGIC
65  打印错误信息("test failed: wrong magic at %d: %u\n", i, magic)
67  转到:err_free_out
71  如果total
72  打印错误信息("test failed: expected zero total, got %d\n", total)
73  转到:err_free_out
76  如果i不等于Expected number of non-NULL elements in the output array
77  打印错误信息("test failed: expected output size %d, got %d\n", Expected number of non-NULL elements in the output array , i)
79  转到:err_free_out
82 i小于Size of each of the NULL-terminated input arrays 减1循环如果out[i]不等于in0[i]或out[i + Size of each of the NULL-terminated input arrays - 1]不等于in1[i]则
84  打印错误信息("test failed: wrong element order at %d\n", i)
85  转到:err_free_out
88  err等于0
89  打印信息("test passed\n")
91  err_free_out :
92  kfree(out)
93  err_free_all_elements :
94  i等于Size of each of the NULL-terminated input arrays
95  err_free_elements :
96 i大于等于0循环
97  kfree(in1[i])
98  kfree(in0[i])
101  kfree(in1)
102  err_free_in0 :
103  kfree(in0)
105  返回:err