]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
iommu: apple: Mark device with DM_FLAG_VITAL
authorJanne Grunau <j@jannau.net>
Sat, 23 Nov 2024 21:44:04 +0000 (22:44 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 24 Nov 2024 21:41:28 +0000 (15:41 -0600)
Avoids NULL pointer dereferences in apple_dart_unmap when the iommu
device is removed before its user. U-boot's device model does not track
dependencies between devices.
Observed on a M1 Ultra Mac Studio with v2024.10.

Acked-by: Mark Kettenis <kettenis@openbsd.org>
Signed-off-by: Janne Grunau <j@jannau.net>
drivers/iommu/apple_dart.c

index 3e9e7819e517b8fe62b9e429b7a8ca3eca29741d..bfd4ad2010547de34d67f48e9b58295429ca8d3c 100644 (file)
@@ -322,5 +322,5 @@ U_BOOT_DRIVER(apple_dart) = {
        .ops = &apple_dart_ops,
        .probe = apple_dart_probe,
        .remove = apple_dart_remove,
-       .flags  = DM_FLAG_OS_PREPARE
+       .flags  = DM_FLAG_OS_PREPARE | DM_FLAG_VITAL
 };