]> git.baikalelectronics.ru Git - kernel.git/commit
device property: Fix the secondary firmware node handling in set_primary_fwnode()
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 21 Aug 2020 10:53:42 +0000 (13:53 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 21 Aug 2020 18:26:21 +0000 (20:26 +0200)
commitc7aa8a55a67d423d08ccf7bb6213d7be335d0a1c
tree3ce1ce42b9723df42b1de567b4cf2deb39f4312e
parentdd44bddf04c5fd83529b139fbfac0a5372c1a87d
device property: Fix the secondary firmware node handling in set_primary_fwnode()

When the primary firmware node pointer is removed from a
device (set to NULL) the secondary firmware node pointer,
when it exists, is made the primary node for the device.
However, the secondary firmware node pointer of the original
primary firmware node is never cleared (set to NULL).

To avoid situation where the secondary firmware node pointer
is pointing to a non-existing object, clearing it properly
when the primary node is removed from a device in
set_primary_fwnode().

Fixes: 6b0ad02ad1c7 ("device property: Make it possible to use secondary firmware nodes")
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/core.c