Commit 8a325dd0 authored by Dan Carpenter's avatar Dan Carpenter Committed by Rob Herring
Browse files

of: Fix a refcounting bug in __of_attach_node_sysfs()

The problem in this code is that if kobject_add() fails, then it should
call of_node_put(np) to drop the reference count.  I've actually moved
the of_node_get(np) later in the function to avoid needing to do clean
up.

Fixes: 5b2c2f5a

 ("of: overlay: add missing of_node_get() in __of_attach_node_sysfs")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 9dae090f
Supports Markdown
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