File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -524,23 +524,29 @@ static int ad5770r_channel_config(struct ad5770r_state *st)
524
524
device_for_each_child_node (& st -> spi -> dev , child ) {
525
525
ret = fwnode_property_read_u32 (child , "num" , & num );
526
526
if (ret )
527
- return ret ;
528
- if (num >= AD5770R_MAX_CHANNELS )
529
- return - EINVAL ;
527
+ goto err_child_out ;
528
+ if (num >= AD5770R_MAX_CHANNELS ) {
529
+ ret = - EINVAL ;
530
+ goto err_child_out ;
531
+ }
530
532
531
533
ret = fwnode_property_read_u32_array (child ,
532
534
"adi,range-microamp" ,
533
535
tmp , 2 );
534
536
if (ret )
535
- return ret ;
537
+ goto err_child_out ;
536
538
537
539
min = tmp [0 ] / 1000 ;
538
540
max = tmp [1 ] / 1000 ;
539
541
ret = ad5770r_store_output_range (st , min , max , num );
540
542
if (ret )
541
- return ret ;
543
+ goto err_child_out ;
542
544
}
543
545
546
+ return 0 ;
547
+
548
+ err_child_out :
549
+ fwnode_handle_put (child );
544
550
return ret ;
545
551
}
546
552
You can’t perform that action at this time.
0 commit comments