Frank Wunderlich
5aa95d8834
iommu: Check if group is NULL before remove device
...
If probe_device is failing, iommu_group is not initialized because
iommu_group_add_device is not reached, so freeing it will result
in NULL pointer access.
iommu_bus_init
->bus_iommu_probe
->probe_iommu_group in for each:/* return -22 in fail case */
->iommu_probe_device
->__iommu_probe_device /* return -22 here.*/
-> ops->probe_device /* return -22 here.*/
-> iommu_group_get_for_dev
-> ops->device_group
-> iommu_group_add_device //good case
->remove_iommu_group //in fail case, it will remove group
->iommu_release_device
->iommu_group_remove_device // here we don't have group
In my case ops->probe_device (mtk_iommu_probe_device from
mtk_iommu_v1.c) is due to failing fwspec->ops mismatch.
Fixes: d72e31c937 ("iommu: IOMMU Groups")
Signed-off-by: Frank Wunderlich <frank-w@public-files.de >
Link: https://lore.kernel.org/r/20210731074737.4573-1-linux@fw-web.de
Signed-off-by: Joerg Roedel <jroedel@suse.de >
2021-08-02 16:22:00 +02:00
..
2021-07-05 14:08:24 -07:00
2021-07-23 17:06:15 +02:00
2021-07-10 09:22:44 -07:00
2021-06-30 15:51:09 -07:00
2021-07-21 17:28:42 +02:00
2021-07-21 17:20:43 +02:00
2021-07-05 14:08:24 -07:00
2021-07-21 13:16:18 +02:00
2021-06-30 15:34:19 -06:00
2021-07-13 19:21:41 -05:00
2021-07-12 10:52:03 +02:00
2021-07-01 13:26:16 -07:00
2021-07-05 14:01:53 -07:00
2021-07-13 11:53:07 -05:00
2021-06-30 14:56:51 +02:00
2021-07-10 09:22:44 -07:00
2021-06-17 17:37:18 -07:00
2021-06-29 10:53:48 -07:00
2021-06-24 10:37:35 +09:00
2021-07-14 11:05:55 -05:00
2021-07-13 15:15:17 +02:00
2021-07-15 11:59:59 -07:00
2021-07-05 13:42:16 -07:00
2021-07-05 13:42:16 -07:00
2021-07-25 10:04:27 -07:00
2021-06-24 15:45:11 +02:00
2021-07-05 12:10:34 -07:00
2021-07-23 11:17:03 +10:00
2021-06-30 09:15:15 +02:00
2021-07-19 09:26:31 +00:00
2021-07-05 13:42:16 -07:00
2021-07-05 13:42:16 -07:00
2021-07-20 22:32:01 +02:00
2021-07-10 11:53:06 -07:00
2021-07-05 14:01:53 -07:00
2021-07-03 11:13:22 -07:00
2021-07-09 10:19:13 -07:00
2021-06-22 22:03:25 +02:00
2021-08-02 16:22:00 +02:00
2021-07-05 14:08:24 -07:00
2021-07-09 15:35:13 +02:00
2021-07-05 14:08:24 -07:00
2021-07-03 11:57:42 -07:00
2021-06-26 12:06:48 -05:00
2021-06-24 15:56:25 +02:00
2021-06-30 18:19:39 -07:00
2021-07-23 11:08:06 -07:00
2021-06-16 17:36:30 -07:00
2021-06-30 12:12:56 -07:00
2021-06-22 23:00:01 -04:00
2021-07-05 13:51:41 -07:00
2021-07-20 22:28:56 +02:00
2021-07-22 09:51:38 -07:00
2021-07-12 11:15:28 -05:00
2021-07-22 10:11:27 -07:00
2021-06-18 12:57:30 -07:00
2021-07-04 11:55:13 -07:00
2021-07-24 12:57:06 -07:00
2021-07-05 13:42:16 -07:00
2021-07-03 10:54:08 -07:00
2021-06-18 09:00:55 +05:30
2021-07-01 11:06:04 -07:00
2021-07-13 13:59:12 -05:00
2021-06-17 19:45:24 +01:00
2021-07-05 14:16:22 -07:00
2021-07-01 16:57:14 -07:00
2021-07-05 13:51:41 -07:00
2021-07-05 13:42:16 -07:00
2021-07-13 14:50:47 -05:00
2021-07-08 12:33:10 -07:00
2021-07-08 16:09:30 +02:00
2021-07-21 12:37:49 -07:00
2021-07-07 10:50:03 -07:00
2021-07-10 09:46:20 -07:00
2021-06-18 13:13:40 -07:00
2021-07-10 16:19:10 -07:00
2021-07-17 13:09:23 -07:00
2021-07-24 13:08:31 -07:00
2021-06-24 15:46:34 +02:00
2021-07-10 09:46:20 -07:00
2021-07-05 13:42:16 -07:00
2021-07-21 12:41:41 -07:00
2021-06-25 10:02:05 +02:00
2021-07-05 14:08:24 -07:00
2021-07-20 23:18:22 -04:00
2021-06-28 20:03:38 -07:00
2021-07-10 11:43:25 -07:00
2021-07-05 14:16:22 -07:00
2021-07-09 10:19:13 -07:00
2021-07-23 10:09:27 -07:00
2021-07-08 07:49:02 -04:00
2021-07-03 11:49:33 -07:00
2021-07-08 07:49:01 -04:00
2021-07-16 11:14:54 -07:00
2021-06-24 15:48:27 +02:00
2021-07-09 11:06:29 -07:00
2021-07-07 12:57:46 -07:00
2021-07-07 11:07:13 -07:00
2021-06-16 08:53:58 -06:00
2021-06-29 11:21:35 -07:00