Xiongfeng Wang
48bd5d3801
gpio: amd8111: Fix PCI device reference count leak
...
[ Upstream commit 45fecdb9f658d9c82960c98240bc0770ade19aca ]
for_each_pci_dev() is implemented by pci_get_device(). The comment of
pci_get_device() says that it will increase the reference count for the
returned pci_dev and also decrease the reference count for the input
pci_dev @from if it is not NULL.
If we break for_each_pci_dev() loop with pdev not NULL, we need to call
pci_dev_put() to decrease the reference count. Add the missing
pci_dev_put() after the 'out' label. Since pci_dev_put() can handle NULL
input parameter, there is no problem for the 'Device not found' branch.
For the normal path, add pci_dev_put() in amd_gpio_exit().
Fixes: f942a7de047d ("gpio: add a driver for GPIO pins found on AMD-8111 south bridge chips")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-14 11:30:44 +01:00
..
2019-03-26 18:38:07 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-05-30 11:26:41 -07:00
2019-06-19 17:09:55 +02:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:25:18 -07:00
2019-05-30 11:29:52 -07:00
2019-07-03 10:24:12 +02:00
2022-12-14 11:30:44 +01:00
2019-07-03 10:10:32 +02:00
2019-07-09 09:07:00 -07:00
2020-07-29 10:18:26 +02:00
2022-01-27 09:19:43 +01:00
2019-07-09 09:07:00 -07:00
2020-06-03 08:21:21 +02:00
2019-11-12 11:18:52 +01:00
2019-08-05 13:25:34 +02:00
2019-05-24 17:36:45 +02:00
2021-06-03 08:59:08 +02:00
2019-05-30 11:26:32 -07:00
2019-09-11 14:50:02 +01:00
2019-02-08 15:55:40 +02:00
2019-07-15 11:03:02 -03:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-07-15 11:52:34 +02:00
2019-06-05 17:37:10 +02:00
2020-06-24 17:50:21 +02:00
2020-12-30 11:50:55 +01:00
2019-07-22 14:40:07 +02:00
2021-02-17 10:35:14 +01:00
2020-06-03 08:21:19 +02:00
2019-05-30 11:26:32 -07:00
2019-08-23 12:02:34 +02:00
2019-05-30 11:26:41 -07:00
2020-02-24 08:36:26 +01:00
2019-02-09 11:33:37 +01:00
2019-08-15 09:57:29 +02:00
2019-09-12 10:07:44 +01:00
2018-12-07 17:34:07 +02:00
2019-10-15 01:18:51 +02:00
2019-07-15 21:10:39 -07:00
2019-06-05 17:37:00 +02:00
2019-09-03 16:04:19 +02:00
2019-07-09 09:07:00 -07:00
2019-06-05 17:36:38 +02:00
2019-04-05 00:04:26 +07:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:10 +02:00
2019-04-05 00:04:26 +07:00
2019-08-15 21:33:07 +02:00
2020-01-04 19:18:20 +01:00
2019-08-05 11:45:24 +02:00
2019-06-19 17:09:55 +02:00
2019-07-09 09:07:00 -07: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-11-12 11:13:54 +01:00
2019-07-29 00:03:52 +02:00
2019-07-31 00:57:21 +02:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:29:19 -07:00
2019-06-05 17:37:17 +02:00
2019-11-03 23:41:11 +01:00
2019-05-30 11:26:39 -07:00
2019-04-08 08:47:06 +02:00
2019-06-19 17:09:55 +02:00
2019-04-08 11:17:43 +02:00
2020-10-07 08:01:24 +02:00
2019-08-14 15:30:56 +02:00
2022-09-28 11:03:57 +02:00
2019-06-05 17:37:06 +02:00
2019-02-08 15:55:41 +02:00
2019-08-23 12:05:06 +02:00
2022-05-25 09:14:37 +02:00
2020-01-04 19:16:27 +01:00
2018-12-21 11:29:57 +01:00
2019-04-05 00:04:27 +07:00
2021-04-28 13:19:14 +02:00
2019-05-30 11:29:52 -07:00
2022-09-15 12:04:52 +02:00
2021-03-04 10:26:49 +01:00
2019-07-23 18:59:05 +03:00
2019-05-30 11:26:41 -07:00
2020-11-18 19:20:31 +01:00
2019-07-09 09:07:00 -07:00
2019-08-05 13:25:34 +02:00
2020-06-03 08:21:21 +02:00
2018-12-17 15:28:30 +01:00
2019-05-30 11:29:52 -07:00
2020-10-01 13:18:04 +02:00
2019-05-24 17:36:45 +02:00
2019-06-19 17:09:06 +02:00
2019-06-19 17:09:55 +02:00
2019-01-11 10:34:37 +01:00
2019-05-30 11:26:32 -07:00
2019-04-23 13:08:33 +02:00
2020-10-07 08:01:23 +02:00
2018-12-07 17:34:08 +02:00
2019-04-05 00:04:27 +07:00
2020-10-07 08:01:27 +02:00
2019-06-05 17:37:06 +02:00
2019-09-11 01:09:37 +01:00
2019-07-09 09:07:00 -07:00
2019-05-30 11:26:32 -07:00
2019-08-05 13:25:34 +02:00
2020-10-07 08:01:24 +02:00
2022-03-02 11:41:17 +01:00
2020-06-03 08:21:09 +02:00
2020-01-23 08:22:29 +01:00
2019-05-30 11:29:19 -07:00
2018-09-04 08:22:47 +02:00
2018-09-04 08:22:47 +02:00
2019-05-24 17:39:01 +02:00
2018-09-04 08:22:47 +02:00
2018-09-04 08:22:47 +02:00
2021-08-12 13:20:57 +02:00
2019-04-05 00:04:28 +07:00
2022-03-16 13:21:46 +01:00
2018-09-04 08:22:47 +02:00
2018-09-10 08:48:51 +02:00
2018-09-10 08:49:22 +02:00
2019-06-19 17:09:55 +02:00
2021-09-30 10:09:23 +02:00
2022-05-25 09:14:37 +02:00
2019-08-05 11:26:58 +02:00
2022-06-29 08:58:46 +02:00
2018-09-17 10:55:24 -07:00
2019-02-08 15:55:41 +02:00
2022-06-29 08:58:47 +02:00
2018-09-17 10:55:24 -07:00
2018-09-17 10:55:24 -07:00
2018-09-17 10:55:24 -07:00
2019-05-30 11:26:41 -07:00
2019-07-31 00:57:21 +02:00
2019-06-19 17:09:07 +02:00
2020-02-19 19:53:02 +01:00
2019-08-15 09:55:07 +02:00
2019-05-30 11:29:52 -07:00
2020-01-09 10:19:59 +01:00
2019-06-19 17:09:55 +02:00
2019-08-23 09:40:44 +02:00
2021-07-20 16:10:44 +02:00
2022-04-20 09:19:35 +02:00
2019-09-10 11:34:20 +01:00
2019-04-08 11:20:12 +02:00
2019-09-11 14:47:39 +01:00
2018-09-25 09:08:48 +02:00
2022-08-25 11:17:57 +02:00
2019-09-11 14:45:01 +01:00
2021-04-21 12:56:13 +02:00
2020-06-03 08:21:28 +02:00
2019-07-31 00:57:21 +02:00
2021-07-07 08:22:58 -04:00
2019-09-16 15:52:38 -07:00
2020-10-07 08:01:28 +02:00
2019-06-14 10:16:15 +02:00