Commit 39af728
device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
The 'parent' returned by fwnode_graph_get_port_parent()
with refcount incremented when 'prev' is not NULL, it
needs be put when finish using it.
Because the parent is const, introduce a new variable to
store the returned fwnode, then put it before returning
from fwnode_graph_get_next_endpoint().
Fixes: b5b41ab ("device property: Check fwnode->secondary in fwnode_graph_get_next_endpoint()")
Signed-off-by: Yang Yingliang <[email protected]>
Reviewed-by: Sakari Ailus <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Reviewed-and-tested-by: Daniel Scally <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent b7bfaa7 commit 39af728
1 file changed
+12
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
997 | 997 | | |
998 | 998 | | |
999 | 999 | | |
| 1000 | + | |
1000 | 1001 | | |
1001 | | - | |
1002 | 1002 | | |
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
1006 | 1006 | | |
1007 | 1007 | | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
1011 | 1012 | | |
| 1013 | + | |
1012 | 1014 | | |
1013 | 1015 | | |
1014 | 1016 | | |
1015 | 1017 | | |
1016 | 1018 | | |
1017 | | - | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1018 | 1022 | | |
1019 | | - | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1020 | 1026 | | |
1021 | 1027 | | |
1022 | 1028 | | |
| |||
0 commit comments