Skip to content

Commit 478573c

Browse files
l1krafaeljw
authored andcommitted
driver core: Don't leak secondary fwnode on device removal
If device_add_property_set() is called for a device, a secondary fwnode is allocated and assigned to the device but currently not freed once the device is removed. This can be triggered on Apple Macs if a Thunderbolt device is plugged in on boot since Apple's NHI EFI driver sets a number of properties for that device which are leaked on unplug. Signed-off-by: Lukas Wunner <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3eab887 commit 478573c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/base/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,7 @@ void device_del(struct device *dev)
12661266
bus_remove_device(dev);
12671267
device_pm_remove(dev);
12681268
driver_deferred_probe_del(dev);
1269+
device_remove_properties(dev);
12691270

12701271
/* Notify the platform of the removal, in case they
12711272
* need to do anything...

0 commit comments

Comments
 (0)