File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -256,12 +256,15 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
256
256
int cpu , err ;
257
257
258
258
err = of_property_read_u32 (dn , "reg" , & cpu );
259
- if (WARN_ON (err ))
259
+ if (WARN_ON (err )) {
260
+ of_node_put (dn );
260
261
return err ;
262
+ }
261
263
262
264
/* If cpu2 or cpu3 is enabled */
263
265
if (cpu & APN806_CLUSTER_NUM_MASK ) {
264
266
nclusters = 2 ;
267
+ of_node_put (dn );
265
268
break ;
266
269
}
267
270
}
@@ -288,8 +291,10 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
288
291
int cpu , err ;
289
292
290
293
err = of_property_read_u32 (dn , "reg" , & cpu );
291
- if (WARN_ON (err ))
294
+ if (WARN_ON (err )) {
295
+ of_node_put (dn );
292
296
return err ;
297
+ }
293
298
294
299
cluster_index = cpu & APN806_CLUSTER_NUM_MASK ;
295
300
cluster_index >>= APN806_CLUSTER_NUM_OFFSET ;
@@ -301,6 +306,7 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
301
306
parent = of_clk_get (np , cluster_index );
302
307
if (IS_ERR (parent )) {
303
308
dev_err (dev , "Could not get the clock parent\n" );
309
+ of_node_put (dn );
304
310
return - EINVAL ;
305
311
}
306
312
parent_name = __clk_get_name (parent );
@@ -319,8 +325,10 @@ static int ap_cpu_clock_probe(struct platform_device *pdev)
319
325
init .parent_names = & parent_name ;
320
326
321
327
ret = devm_clk_hw_register (dev , & ap_cpu_clk [cluster_index ].hw );
322
- if (ret )
328
+ if (ret ) {
329
+ of_node_put (dn );
323
330
return ret ;
331
+ }
324
332
ap_cpu_data -> hws [cluster_index ] = & ap_cpu_clk [cluster_index ].hw ;
325
333
}
326
334
You can’t perform that action at this time.
0 commit comments