]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Sep 2020 09:22:32 +0000 (11:22 +0200)
commitfb545b9fc756332f4430307ccf7b58e4f3d5f64f
treebfa785ac7922e299f991adfbbc355b677dc6a5ae
parentef0a51a72bd2e3f6c78c1dd871aa4bc27ecc6bf5
device property: Fix the secondary firmware node handling in set_primary_fwnode()

commit c15e1bdda4365a5f17cdadf22bf1c1df13884a9e upstream.

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: 97badf873ab6 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/core.c