
Zhengchao ShaoandGreg Kroah-Hartman
0b5a89e8bc
test_firmware: fix memory leak in test_firmware_init()
[ Upstream commit 7610615e8c ]
When misc_register() failed in test_firmware_init(), the memory pointed
by test_fw_config->name is not released. The memory leak information is
as follows:
unreferenced object 0xffff88810a34cb00 (size 32):
comm "insmod", pid 7952, jiffies 4294948236 (age 49.060s)
hex dump (first 32 bytes):
74 65 73 74 2d 66 69 72 6d 77 61 72 65 2e 62 69 test-firmware.bi
6e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 n...............
backtrace:
[<ffffffff81b21fcb>] __kmalloc_node_track_caller+0x4b/0xc0
[<ffffffff81affb96>] kstrndup+0x46/0xc0
[<ffffffffa0403a49>] __test_firmware_config_init+0x29/0x380 [test_firmware]
[<ffffffffa040f068>] 0xffffffffa040f068
[<ffffffff81002c41>] do_one_initcall+0x141/0x780
[<ffffffff816a72c3>] do_init_module+0x1c3/0x630
[<ffffffff816adb9e>] load_module+0x623e/0x76a0
[<ffffffff816af471>] __do_sys_finit_module+0x181/0x240
[<ffffffff89978f99>] do_syscall_64+0x39/0xb0
[<ffffffff89a0008b>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
Fixes: c92316bf8e ("test_firmware: add batched firmware tests")
Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Link: https://lore.kernel.org/r/20221119035721.18268-1-shaozhengchao@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-01-14 10:15:56 +01:00
..
2022-09-05 10:28:55 +02:00
2022-05-18 10:23:44 +02:00
2023-01-14 10:15:17 +01:00
2022-04-08 14:40:04 +02:00
2022-08-21 15:16:05 +02:00
2022-04-13 21:01:08 +02:00
2021-07-14 16:56:51 +02:00
2022-01-27 10:54:02 +01:00
2022-04-08 14:40:31 +02:00
2022-12-02 17:40:02 +01:00
2021-11-18 14:03:58 +01:00
2021-01-06 14:56:51 +01:00
2022-06-06 08:42:41 +02:00
2020-10-16 13:25:14 -06:00
2022-08-21 15:15:45 +02:00
2021-05-14 09:50:32 +02:00
2021-02-17 11:02:24 +01:00
2020-10-16 11:11:20 -07:00
2020-11-02 12:14:19 -08:00
2021-06-30 08:47:18 -04:00
2023-01-14 10:15:16 +01:00
2020-10-16 11:11:19 -07:00
2021-07-20 16:05:46 +02:00
2021-11-18 14:03:58 +01:00
2022-10-26 13:25:34 +02:00
2020-10-16 11:11:20 -07:00
2020-10-16 11:11:20 -07:00
2020-10-16 11:11:22 -07:00
2020-10-16 11:11:19 -07:00
2021-01-12 20:18:16 +01:00
2022-05-09 09:04:59 +02:00
2022-07-12 16:32:23 +02:00
2023-01-04 11:39:16 +01:00
2022-06-22 14:13:18 +02:00
2022-12-08 11:23:58 +01:00
2020-10-13 18:38:32 -07:00
2020-09-28 12:14:08 +01:00
2020-10-16 11:11:22 -07:00
2021-05-19 10:13:18 +02:00
2021-07-14 16:55:57 +02:00
2021-07-14 16:55:57 +02:00
2020-10-16 11:11:19 -07:00
2022-08-25 11:38:18 +02:00
2021-09-30 10:11:04 +02:00
2021-07-14 16:56:10 +02:00
2021-03-17 17:06:25 +01:00
2022-06-22 14:13:18 +02:00
2022-06-22 14:13:18 +02:00
2020-09-26 10:33:57 -07:00
2021-05-19 10:13:08 +02:00
2022-06-14 18:32:45 +02:00
2023-01-14 10:15:19 +01:00
2022-10-26 13:25:23 +02:00
2020-10-16 11:11:20 -07:00
2022-06-06 08:42:40 +02:00
2020-10-20 14:39:37 -07:00
2022-05-30 09:33:38 +02:00
2022-08-31 17:15:20 +02:00
2020-10-29 08:55:45 -06:00
2021-07-19 09:45:00 +02:00
2022-05-30 09:33:26 +02:00
2022-05-30 09:33:43 +02:00
2022-08-21 15:16:08 +02:00
2021-05-22 11:40:55 +02:00
2020-09-30 10:50:30 +02:00
2020-09-26 10:33:57 -07:00
2020-11-19 11:56:16 -08:00
2020-12-03 09:52:44 -08:00
2022-08-21 15:15:41 +02:00
2023-01-14 10:15:56 +01:00
2020-10-13 18:38:33 -07:00
2022-01-27 10:54:36 +01:00
2020-10-13 18:38:32 -07:00
2021-05-19 10:13:11 +02:00
2022-04-08 14:40:30 +02:00
2021-09-30 10:11:04 +02:00
2022-04-08 14:40:35 +02:00
2022-01-27 10:54:36 +01:00
2021-09-18 13:40:37 +02:00
2020-10-16 11:11:20 -07:00
2022-04-13 21:01:10 +02:00
2022-04-08 14:40:40 +02:00
2021-02-17 11:02:24 +01:00
2021-02-17 11:02:24 +01:00
2020-10-16 11:11:22 -07:00
2022-05-30 09:33:38 +02:00
2022-04-08 14:40:40 +02:00