Skip to content

Commit d8dfab0

Browse files
Anson-HuangShawn Guo
authored andcommitted
soc: imx: soc-imx8: Avoid unnecessary of_node_put() in error handling
of_node_put() is called after of_match_node() successfully called, then in the following error handling, of_node_put() is called again which is unnecessary, this patch adjusts the location of of_node_put() to avoid such scenario. Signed-off-by: Anson Huang <[email protected]> Reviewed-by: Leonard Crestez <[email protected]> Signed-off-by: Shawn Guo <[email protected]>
1 parent 15f5276 commit d8dfab0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/soc/imx/soc-imx8.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ static int __init imx8_soc_init(void)
115115
if (!id)
116116
goto free_soc;
117117

118-
of_node_put(root);
119-
120118
data = id->data;
121119
if (data) {
122120
soc_dev_attr->soc_id = data->name;
@@ -132,6 +130,8 @@ static int __init imx8_soc_init(void)
132130
if (IS_ERR(soc_dev))
133131
goto free_rev;
134132

133+
of_node_put(root);
134+
135135
return 0;
136136

137137
free_rev:

0 commit comments

Comments
 (0)