Context |
Check |
Description |
tedd_an/pre-ci_am |
success
|
Success
|
tedd_an/checkpatch |
success
|
Checkpatch PASS
|
tedd_an/gitlint |
success
|
Gitlint PASS
|
tedd_an/subjectprefix |
success
|
PASS
|
tedd_an/buildkernel |
success
|
Build Kernel PASS
|
tedd_an/buildkernel32 |
success
|
Build Kernel32 PASS
|
tedd_an/incremental_build |
success
|
Pass
|
tedd_an/testrunnersetup |
success
|
Test Runner Setup PASS
|
tedd_an/testrunnerl2cap-tester |
success
|
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunneriso-tester |
success
|
Total: 55, Passed: 55 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnerbnep-tester |
success
|
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnermgmt-tester |
success
|
Total: 494, Passed: 494 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnerrfcomm-tester |
success
|
Total: 11, Passed: 11 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnersco-tester |
success
|
Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnerioctl-tester |
success
|
Total: 28, Passed: 28 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnermesh-tester |
success
|
Total: 10, Passed: 10 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunnersmp-tester |
success
|
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
|
tedd_an/testrunneruserchan-tester |
success
|
Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0
|
@@ -233,8 +233,6 @@ static int __init test_ecdh(void)
goto done;
}
- crypto_free_kpp(tfm);
-
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
@@ -248,6 +246,8 @@ static int __init test_ecdh(void)
else
snprintf(test_ecdh_buffer, sizeof(test_ecdh_buffer), "FAIL\n");
+ crypto_free_kpp(tfm);
+
debugfs_create_file("selftest_ecdh", 0444, bt_debugfs, NULL,
&test_ecdh_fops);
kmemleak reported: Bluetooth: ECDH sample 1 failed kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak) unreferenced object 0xffff888102149100 (size 96): comm "modprobe", pid 418, jiffies 4295082093 (age 610.644s) ... backtrace: [<00000000c8e4e5a6>] __kmalloc_node+0x4c/0x1c0 [<000000006cdcfddc>] crypto_create_tfm_node+0x89/0x320 [<00000000e222ad46>] crypto_alloc_tfm_node+0xfd/0x2f0 [<00000000871fc045>] 0xffffffffc05c94ab [<00000000e889f45e>] 0xffffffffc05c8024 [<000000001ff0c346>] do_one_initcall+0xd0/0x4e0 ... In test_ecdh(), when test sample fails, crypto_free_kpp(tfm) is not called, which makes tfm memory leaked. Fix it by moving crypto_free_kpp behind done label. Fixes: 47eb2ac80918 ("Bluetooth: move ecdh allocation outside of ecdh_helper") Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> --- net/bluetooth/selftest.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)