Skip to content

Commit

Permalink
driver core: Don't leak secondary fwnode on device removal
Browse files Browse the repository at this point in the history
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 <lukas@wunner.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lukas Wunner authored and Rafael J. Wysocki committed Aug 30, 2016
1 parent 3eab887 commit 478573c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,6 +1266,7 @@ void device_del(struct device *dev)
bus_remove_device(dev);
device_pm_remove(dev);
driver_deferred_probe_del(dev);
device_remove_properties(dev);

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

0 comments on commit 478573c

Please sign in to comment.