Geert Uytterhoeven
6a8b02ead7
PCI: Fix pci_register_io_range() memory leak
[ Upstream commit f6bda644fa3a7070621c3bf12cd657f69a42f170 ]
Kmemleak reports:
unreferenced object 0xc328de40 (size 64):
comm "kworker/1:1", pid 21, jiffies 4294938212 (age 1484.670s)
hex dump (first 32 bytes):
00 00 00 00 00 00 00 00 e0 d8 fc eb 00 00 00 00 ................
00 00 10 fe 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ad758d10>] pci_register_io_range+0x3c/0x80
[<2c7f139e>] of_pci_range_to_resource+0x48/0xc0
[<f079ecc8>] devm_of_pci_get_host_bridge_resources.constprop.0+0x2ac/0x3ac
[<e999753b>] devm_of_pci_bridge_init+0x60/0x1b8
[<a895b229>] devm_pci_alloc_host_bridge+0x54/0x64
[<e451ddb0>] rcar_pcie_probe+0x2c/0x644
In case a PCI host driver's probe is deferred, the same I/O range may be
allocated again, and be ignored, causing a memory leak.
Fix this by (a) letting logic_pio_register_range() return -EEXIST if the
passed range already exists, so pci_register_io_range() will free it, and
by (b) making pci_register_io_range() not consider -EEXIST an error
condition.
Link: https://lore.kernel.org/r/20210202100332.829047-1-geert+renesas@glider.be
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-17 16:43:46 +01:00
..
2017-11-02 11:10:55 +01:00
2020-11-10 12:35:57 +01:00
2017-10-03 17:54:25 -07:00
2017-11-02 11:10:55 +01:00
2020-06-22 09:05:14 +02:00
2020-04-23 10:30:15 +02:00
2019-07-26 09:14:12 +02:00
2018-10-02 08:44:59 +10:00
2015-09-10 13:29:01 -07:00
2020-06-25 15:33:02 +02:00
2018-03-26 02:01:27 +09:00
2018-08-22 10:52:48 -07:00
2018-06-12 16:19:22 -07:00
2017-12-01 13:09:40 -08:00
2017-12-01 13:09:40 -08:00
2017-12-08 15:13:27 +00:00
2019-03-23 20:09:48 +01:00
2017-07-14 15:05:13 -07:00
2018-06-21 14:25:21 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-10-12 09:17:46 +02:00
2019-12-01 09:17:08 +01:00
2019-04-05 22:33:08 +02:00
2018-03-14 16:55:29 -07:00
2018-08-16 12:14:42 -07:00
2018-03-09 16:40:01 -08:00
2017-11-02 11:10:55 +01:00
2019-11-20 18:47:11 +01:00
2017-11-02 11:10:55 +01:00
2016-03-13 23:55:13 -04:00
2017-11-02 11:10:55 +01:00
2017-09-08 18:26:49 -07:00
2017-12-01 13:09:40 -08:00
2017-11-02 11:10:55 +01:00
2015-05-27 15:22:15 +02:00
2018-02-06 18:32:44 -08:00
2017-09-26 15:01:20 -06:00
2017-09-26 15:01:20 -06:00
2020-10-30 10:38:21 +01:00
2018-07-27 19:04:33 +08:00
2020-11-10 12:35:57 +01:00
2018-08-22 10:52:48 -07:00
2018-01-08 10:08:33 +00:00
2015-05-26 15:26:43 +02:00
2015-05-30 22:42:24 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-11-13 11:08:20 -08:00
2018-12-17 09:24:41 +01:00
2018-06-12 23:33:24 +02:00
2018-07-27 19:16:38 +08:00
2017-11-02 11:10:55 +01:00
2017-02-24 17:46:57 -08:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2015-09-10 13:29:01 -07:00
2017-11-02 11:10:55 +01:00
2020-05-10 10:30:11 +02:00
2017-10-12 17:16:40 +01:00
2019-04-20 09:16:05 +02:00
2019-11-12 19:20:37 +01:00
2020-08-19 08:14:53 +02:00
2017-11-15 11:56:19 -08:00
2016-06-08 11:04:19 +02:00
2018-01-12 17:33:38 -08:00
2018-04-27 08:51:26 -04:00
2017-07-10 16:32:35 -07:00
2017-08-10 15:54:06 -07:00
2018-05-11 17:28:45 -07:00
2020-04-17 10:48:43 +02:00
2017-11-02 11:10:55 +01:00
2017-10-07 10:45:14 -06:00
2018-07-27 19:04:33 +08:00
2018-08-22 10:52:48 -07:00
2021-01-12 20:10:16 +01:00
2017-02-24 17:46:57 -08:00
2017-02-24 17:46:57 -08:00
2017-09-08 18:26:49 -07:00
2017-11-02 11:10:55 +01:00
2019-12-17 20:36:02 +01:00
2017-11-02 11:10:55 +01:00
2019-01-22 21:40:34 +01:00
2018-06-12 16:19:22 -07:00
2016-01-20 17:09:18 -08:00
2017-11-02 11:10:55 +01:00
2018-05-09 06:55:44 +02:00
2018-07-04 21:37:08 +02:00
2019-05-22 07:37:45 +02:00
2017-11-02 11:10:55 +01:00
2017-03-02 08:42:38 +01:00
2017-11-02 11:10:55 +01:00
2018-08-22 10:52:48 -07:00
2019-10-07 18:57:17 +02:00
2018-07-26 19:38:03 -07:00
2017-05-16 08:44:22 -03:00
2018-08-10 20:19:58 -07:00
2020-01-27 14:51:08 +01:00
2018-07-02 16:20:23 -04:00
2019-05-31 06:46:28 -07:00
2018-08-18 11:44:53 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-03-26 15:09:38 +02:00
2018-04-11 10:28:35 -07:00
2017-11-02 11:10:55 +01:00
2017-10-25 11:01:08 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2018-07-03 09:44:36 +02:00
2018-04-12 09:41:19 -07:00
2021-03-17 16:43:46 +01:00
2018-06-12 16:19:22 -07:00
2017-12-01 13:09:40 -08:00
2020-05-27 17:37:27 +02:00
2017-11-02 11:10:55 +01:00
2017-12-01 13:09:40 -08:00
2017-11-02 11:10:55 +01:00
2015-12-03 11:49:23 -05:00
2018-06-28 16:18:04 +09:00
2018-07-09 14:10:40 +02:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2017-12-08 15:13:28 +00:00
2017-11-04 09:26:51 +09:00
2017-02-03 16:35:42 -05:00
2016-12-06 10:17:03 +02:00
2018-01-26 11:45:16 -06:00
2018-08-30 12:56:40 +02:00
2018-03-19 10:09:44 -07:00
2017-03-02 08:42:27 +01:00
2017-01-23 09:17:12 +01:00
2019-12-05 09:19:40 +01:00
2020-11-18 19:18:52 +01:00
2017-10-03 17:54:26 -07:00
2017-11-02 11:10:55 +01:00
2018-06-12 16:19:22 -07:00
2017-12-14 16:00:48 -08:00
2018-07-07 01:45:31 +02:00
2018-07-17 09:27:43 +02:00
2019-04-03 06:26:17 +02:00
2019-05-31 06:46:00 -07:00
2020-11-05 11:08:45 +01:00
2019-02-12 19:47:16 +01:00
2016-04-15 16:53:14 -04:00
2015-08-24 14:28:01 -06:00
2017-11-02 11:10:55 +01:00
2018-04-13 17:10:28 -07:00
2017-02-22 16:41:30 -08:00
2017-01-09 13:58:57 -05:00
2018-01-05 15:24:00 +01:00
2017-11-02 11:10:55 +01:00
2020-02-28 16:38:55 +01:00
2017-09-13 18:53:16 -07:00
2021-02-13 13:51:15 +01:00
2020-06-22 09:04:59 +02:00
2020-06-22 09:04:59 +02:00
2017-11-02 11:10:55 +01:00
2018-06-27 18:58:49 +03:00
2018-05-18 17:17:12 -07:00
2018-06-28 23:58:39 +02:00
2019-01-13 09:51:10 +01:00
2019-08-16 10:12:49 +02:00
2016-09-01 17:52:01 -07:00
2018-12-08 12:59:06 +01:00
2018-10-15 16:31:29 -04:00
2020-02-11 04:33:57 -08:00
2020-08-21 11:05:38 +02:00
2017-11-17 16:10:01 -08:00
2019-08-06 19:06:51 +02:00
2017-02-26 11:03:38 -05:00
2018-06-25 13:44:20 +02:00
2019-02-12 19:47:21 +01:00
2017-01-09 13:58:57 -05:00
2018-02-06 18:32:45 -08:00
2015-08-03 11:51:12 +02:00
2016-02-09 10:27:29 +01:00
2019-08-06 19:06:51 +02:00
2017-07-12 16:26:00 -07:00
2018-04-11 10:28:35 -07:00
2018-03-26 15:55:57 +02:00
2017-07-21 09:38:30 +02:00
2015-09-10 13:29:01 -07:00
2016-02-03 08:28:43 -08:00
2019-10-29 09:19:35 +01:00
2017-12-29 23:13:10 +01:00
2017-10-22 03:14:07 +01:00
2017-10-22 03:14:07 +01:00
2019-05-10 17:54:04 +02:00
2018-02-06 18:32:46 -08:00
2018-04-23 16:39:35 +01:00
2018-06-07 17:34:39 -07:00
2017-12-11 09:35:11 -05:00
2017-12-11 15:03:08 -07:00
2018-10-05 10:17:15 -04:00
2017-11-02 11:10:55 +01:00
2017-08-15 09:02:07 -07:00