Zhang Xiaoxu
53b9b1201e
Input: raydium_ts_i2c - fix memory leak in raydium_i2c_send()
commit 8c9a59939d 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: 3b384bd6c3 ("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:28:45 +01:00
..
2019-08-14 10:49:01 -07:00
2020-12-10 23:39:15 -08:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:25:18 -07:00
2020-12-02 22:10:33 -08:00
2019-05-30 11:25:18 -07:00
2021-02-22 21:21:03 -08:00
2021-03-25 15:27:56 -07:00
2021-12-29 12:28:52 +01:00
2020-12-02 22:10:33 -08:00
2019-08-14 10:49:01 -07:00
2019-09-02 09:07:38 -07:00
2021-03-25 15:27:56 -07:00
2020-12-02 22:10:33 -08:00
2020-03-20 14:57:54 +01:00
2019-10-27 11:14:22 -07:00
2020-05-09 22:26:48 -07:00
2021-06-05 20:34:16 -07:00
2020-11-08 22:35:48 -08:00
2020-11-08 22:35:48 -08:00
2019-06-05 17:36:37 +02:00
2019-06-05 17:36:37 +02:00
2021-06-01 21:13:11 -07:00
2021-06-01 21:13:11 -07:00
2019-06-05 17:36:37 +02:00
2021-06-01 21:13:11 -07:00
2021-06-01 21:13:11 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2019-06-19 17:09:55 +02:00
2021-09-05 19:10:11 -07:00
2020-12-02 22:10:33 -08:00
2019-06-19 17:09:55 +02:00
2018-09-18 15:28:07 -07:00
2020-12-02 22:10:33 -08:00
2021-12-29 12:29:00 +01:00
2021-02-18 14:39:42 -08:00
2022-08-25 11:40:08 +02:00
2019-08-14 10:49:01 -07:00
2019-06-19 17:09:55 +02:00
2022-12-02 17:41:10 +01:00
2022-07-12 16:34:51 +02:00
2019-05-30 11:26:35 -07:00
2019-06-19 17:09:55 +02:00
2021-06-19 22:36:28 -07:00
2019-05-21 10:50:45 +02:00
2021-01-26 07:42:27 +01:00
2021-04-13 19:08:30 -07:00
2022-05-25 09:57:36 +02:00
2021-04-09 23:23:01 -07:00
2020-12-02 22:10:33 -08:00
2019-06-19 17:09:55 +02:00
2020-12-02 22:10:33 -08:00
2021-03-25 11:14:10 -07:00
2019-06-19 17:09:55 +02:00
2021-09-03 23:49:55 -07:00
2021-03-20 19:48:37 -07:00
2019-05-30 11:26:32 -07:00
2021-04-13 19:08:30 -07:00
2020-07-07 11:25:54 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:26:32 -07:00
2022-10-05 10:39:42 +02:00
2018-11-12 11:52:05 -08:00
2019-06-19 17:09:55 +02:00
2021-09-06 23:33:26 -07:00
2021-04-09 23:22:38 -07:00
2019-06-19 17:09:55 +02:00
2019-07-24 12:48:47 +03:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2020-12-02 22:10:33 -08:00
2021-03-22 17:59:51 +01:00
2022-12-08 11:28:45 +01:00
2021-10-15 22:11:03 -07:00
2019-06-05 17:36:37 +02:00
2020-08-19 21:44:11 +02:00
2021-03-07 15:14:25 -08:00
2021-04-09 22:42:20 -07:00
2019-06-05 17:36:37 +02:00
2021-11-18 19:17:01 +01:00
2022-06-09 10:23:13 +02:00
2021-01-19 19:03:18 -08:00
2020-01-10 14:42:52 -08:00
2021-02-16 20:39:53 -08:00
2021-01-19 19:03:16 -08:00
2019-06-19 17:09:55 +02:00
2022-03-08 19:12:35 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-10-29 17:13:41 -07:00
2019-10-29 17:13:40 -07:00
2019-06-05 17:37:05 +02:00
2021-06-19 22:36:23 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2021-03-15 17:12:04 -07:00
2020-06-14 11:49:59 +01:00
2021-03-15 17:12:02 -07:00
2020-12-02 22:10:33 -08:00
2021-05-24 20:56:11 -07:00
2021-03-25 11:14:09 -07:00
2019-08-20 12:03:46 -07:00
2018-07-27 11:59:05 -07:00
2020-12-02 22:10:33 -08:00
2021-03-25 15:27:56 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:37 -07:00
2020-12-02 22:10:33 -08:00
2022-04-08 14:22:47 +02:00
2019-05-30 11:26:32 -07:00