Zhang Xiaoxu
a82869ac52
Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send()
...
commit 8c9a59939deb4bfafdc451100c03d1e848b4169b upstream.
There is a kmemleak when test the raydium_i2c_ts with bpf mock device:
unreferenced object 0xffff88812d3675a0 (size 8):
comm "python3", pid 349, jiffies 4294741067 (age 95.695s)
hex dump (first 8 bytes):
11 0e 10 c0 01 00 04 00 ........
backtrace:
[<0000000068427125>] __kmalloc+0x46/0x1b0
[<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts]
[<000000006e631aee>] raydium_i2c_initialize.cold+0xbc/0x3e4 [raydium_i2c_ts]
[<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts]
[<00000000a310de16>] i2c_device_probe+0x651/0x680
[<00000000f5a96bf3>] really_probe+0x17c/0x3f0
[<00000000096ba499>] __driver_probe_device+0xe3/0x170
[<00000000c5acb4d9>] driver_probe_device+0x49/0x120
[<00000000264fe082>] __device_attach_driver+0xf7/0x150
[<00000000f919423c>] bus_for_each_drv+0x114/0x180
[<00000000e067feca>] __device_attach+0x1e5/0x2d0
[<0000000054301fc2>] bus_probe_device+0x126/0x140
[<00000000aad93b22>] device_add+0x810/0x1130
[<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0
[<000000003c2c248c>] of_i2c_register_device+0xf1/0x110
[<00000000ffec4177>] of_i2c_notify+0x100/0x160
unreferenced object 0xffff88812d3675c8 (size 8):
comm "python3", pid 349, jiffies 4294741070 (age 95.692s)
hex dump (first 8 bytes):
22 00 36 2d 81 88 ff ff ".6-....
backtrace:
[<0000000068427125>] __kmalloc+0x46/0x1b0
[<0000000090180f91>] raydium_i2c_send+0xd4/0x2bf [raydium_i2c_ts]
[<000000001d5c9620>] raydium_i2c_initialize.cold+0x223/0x3e4 [raydium_i2c_ts]
[<00000000dc6fcf38>] raydium_i2c_probe+0x3cd/0x6bc [raydium_i2c_ts]
[<00000000a310de16>] i2c_device_probe+0x651/0x680
[<00000000f5a96bf3>] really_probe+0x17c/0x3f0
[<00000000096ba499>] __driver_probe_device+0xe3/0x170
[<00000000c5acb4d9>] driver_probe_device+0x49/0x120
[<00000000264fe082>] __device_attach_driver+0xf7/0x150
[<00000000f919423c>] bus_for_each_drv+0x114/0x180
[<00000000e067feca>] __device_attach+0x1e5/0x2d0
[<0000000054301fc2>] bus_probe_device+0x126/0x140
[<00000000aad93b22>] device_add+0x810/0x1130
[<00000000c086a53f>] i2c_new_client_device+0x352/0x4e0
[<000000003c2c248c>] of_i2c_register_device+0xf1/0x110
[<00000000ffec4177>] of_i2c_notify+0x100/0x160
After BANK_SWITCH command from i2c BUS, no matter success or error
happened, the tx_buf should be freed.
Fixes: 3b384bd6c3f2 ("Input: raydium_ts_i2c - do not split tx transactions")
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Link: https://lore.kernel.org/r/20221202103412.2120169-1-zhangxiaoxu5@huawei.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-12-08 11:23:59 +01:00
..
2022-11-25 17:45:50 +01:00
2022-12-08 11:23:59 +01:00
2022-12-02 17:40:04 +01:00
2022-12-02 17:39:57 +01:00
2022-08-25 11:38:02 +02:00
2022-11-03 23:57:53 +09:00
2022-11-25 17:45:47 +01:00
2022-10-26 13:25:21 +02:00
2022-12-02 17:39:59 +01:00
2022-12-08 11:23:59 +01:00
2022-12-08 11:23:54 +01:00
2022-12-08 11:23:59 +01:00
2022-11-03 23:57:50 +09:00
2022-10-30 09:41:15 +01:00
2022-10-26 13:25:43 +02:00
2022-09-28 11:10:41 +02:00
2022-07-07 17:52:18 +02:00
2022-11-16 09:57:20 +01:00
2022-12-02 17:40:01 +01:00
2022-08-03 12:00:50 +02:00
2022-06-14 18:32:43 +02:00
2022-05-12 12:25:32 +02:00
2022-11-25 17:45:53 +01:00
2022-10-26 13:25:33 +02:00
2022-10-26 13:25:38 +02:00
2022-09-28 11:10:27 +02:00
2022-12-08 11:23:58 +01:00
2022-11-16 09:57:08 +01:00
2022-10-26 13:25:32 +02:00
2022-12-02 17:40:00 +01:00
2022-12-08 11:23:57 +01:00
2022-11-16 09:57:07 +01:00
2022-11-10 18:14:25 +01:00
2022-12-08 11:23:59 +01:00
2022-07-25 11:26:43 +02:00
2022-12-08 11:23:54 +01:00
2022-11-10 18:14:17 +01:00
2022-12-08 11:23:59 +01:00
2022-09-28 11:10:28 +02:00
2022-12-08 11:23:58 +01:00
2022-12-02 17:40:06 +01:00
2022-11-25 17:45:46 +01:00
2022-10-26 13:25:18 +02:00
2022-05-09 09:04:56 +02:00
2022-08-11 13:06:47 +02:00
2022-10-26 13:25:40 +02:00
2022-12-02 17:40:05 +01:00
2022-11-10 18:14:22 +01:00
2022-10-26 13:25:28 +02:00
2022-08-21 15:15:58 +02:00
2022-11-25 17:45:41 +01:00
2022-11-25 17:45:54 +01:00
2022-12-08 11:23:58 +01:00
2022-11-25 17:45:41 +01:00
2022-12-08 11:23:57 +01:00
2022-12-02 17:40:02 +01:00
2022-08-25 11:38:01 +02:00
2022-07-07 17:52:15 +02:00
2022-12-02 17:39:57 +01:00
2022-12-08 11:23:55 +01:00
2022-08-21 15:16:04 +02:00
2022-11-10 18:14:27 +01:00
2022-11-25 17:45:44 +01:00
2022-10-26 13:25:11 +02:00
2022-06-14 18:32:30 +02:00
2022-09-20 12:38:32 +02:00
2022-11-16 09:57:08 +01:00
2022-12-08 11:23:58 +01:00
2022-12-02 17:40:05 +01:00
2022-10-26 13:25:52 +02:00
2022-10-26 13:25:44 +02:00
2022-08-21 15:15:37 +02:00
2022-12-02 17:40:01 +01:00
2022-08-21 15:16:08 +02:00
2022-10-05 10:38:40 +02:00
2022-10-15 07:55:54 +02:00
2022-06-14 18:32:33 +02:00
2022-12-02 17:40:02 +01:00
2022-12-02 17:39:59 +01:00
2022-11-25 17:45:44 +01:00
2022-11-25 17:45:50 +01:00
2022-10-26 13:25:29 +02:00
2022-10-26 13:25:53 +02:00
2022-12-08 11:23:54 +01:00
2022-10-26 13:25:39 +02:00
2022-11-10 18:14:22 +01:00
2022-11-25 17:45:55 +01:00
2022-12-02 17:39:59 +01:00
2022-10-26 13:25:56 +02:00
2022-10-26 13:25:16 +02:00
2022-12-08 11:23:59 +01:00
2022-12-02 17:40:04 +01:00
2022-06-09 10:21:29 +02:00
2022-09-28 11:10:38 +02:00
2022-10-26 13:25:22 +02:00
2022-11-10 18:14:21 +01:00
2022-08-25 11:38:14 +02:00
2022-07-21 21:20:13 +02:00
2022-08-21 15:16:10 +02:00
2022-12-02 17:40:05 +01:00