Skip to content
Commit 5dca69e2 authored by Heikki Krogerus's avatar Heikki Krogerus Committed by Rafael J. Wysocki
Browse files

software node: Handle software node injection to an existing device properly



The function software_node_notify() - the function that creates
and removes the symlinks between the node and the device - was
called unconditionally in device_add_software_node() and
device_remove_software_node(), but it needs to be called in
those functions only in the special case where the node is
added to a device that has already been registered.

This fixes NULL pointer dereference that happens if
device_remove_software_node() is used with device that was
never registered.

Fixes: b622b245 ("software node: Allow node addition to already existing device")
Reported-and-tested-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarHeikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 13311e74
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment